Relaxing “Declare Before Use” Within Classes

Members of a class are declared in the class declaration. In the implementation, the order of declarations in the class does not affect visibility, so a member function declared first in the class can call on a function declared fifth. In effect, every member in the class declaration is visible to every member function implementation.

This does not hold true within the class declaration. The following would be invalid because anOperator has not been declared before it is used for a formal argument in Accumulate():

void Accumulate
(
    anOperator theOperator,
    float theOperand = 0
);
enum anOperator
   {add,subtract,multiply,divide,query,reset} ;

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.199.130