inline function definiton : inline « Class « C++ Tutorial






#include <iostream>

class Cat
{
public:
    Cat (int initialAge);
    ~Cat();
    int GetAge() { return itsAge;}             // inline!
    void SetAge (int age) { itsAge = age;}     // inline!
    void Meow() { std::cout << "Meow.\n";}     // inline!
private:
    int itsAge;
};








9.24.inline
9.24.1.inline functions
9.24.2.inline function definiton
9.24.3.inline method
9.24.4.Automatic inline functions
9.24.5.Defines constructor, destructor, and range() function in-line
9.24.6.Using an inline function to calculate the volume of a cube.