Point of Class Definition

A class is defined at the end of its class specifier. Member functions need not be defined in order for the class to be considered defined. Consider the following:

// point_of_class_definition.cpp
class Point                    // Point class
{                              //  considered defined.
public:
    Point()
        { cx = cy = 0; }       // Constructor defined.
    Point( int x, int y )
        { cx = x, cy = y; }    // Constructor defined.
    unsigned &x( unsigned );   // Accessor declared.
    unsigned &y( unsigned );   // Accessor declared.
private:
    unsigned  cx, cy;
};
int main()
{
}

Even though the two accessor functions (x and y) are not defined, the class Point is considered defined. (Accessor functions are functions provided to help give safe access to member data.)

See Also

Reference

Defining Class Types