August 2012
Intermediate to advanced
976 pages
30h 17m
English
Although a nested class is defined in the scope of its enclosing class, it is important to understand that there is no connection between the objects of an enclosing class and objects of its nested classe(s). A nested-type object contains only the members defined inside the nested type. Similarly, an object of the enclosing class has only those members that are defined by the enclosing class. It does not contain the data members of any nested classes.
More concretely, the second return statement in TextQuery::query
return QueryResult(sought, loc->second, file);
uses data members of the TextQuery object on which query was run to initialize a QueryResult object. We have to use these members to construct ...
Read now
Unlock full access