May 2012
Intermediate to advanced
679 pages
16h 56m
English
In the earlier chapter, we have seen the use of keyword inline with global functions. It tells the compiler to replace every function call in a source code by actual code of that function. We can request the compiler for inline expansion for member functions too. Let us study inline functions within a class. This can be done in two different styles.
Style1: When a member function is fully defined in the class definition for example.
Syntax:
class SomeClass { <datatype> <function_name>(<parameters>) { <statements>; } }
Here we combine function declaration and definition. Note the absence of keyword inline. Such functions are inline by default. It should be noted that the function definition ...
Read now
Unlock full access