August 2012
Intermediate to advanced
976 pages
30h 17m
English
In this version, we did not define the QueryResult constructor inside the class body. To define the constructor, we must indicate that QueryResult is nested within the scope of TextQuery. We do so by qualifying the nested class name with the name of its enclosing class:
// defining the member named QueryResult for the class named QueryResult// that is nested inside the class TextQueryTextQuery::QueryResult::QueryResult(string s, shared_ptr<set<line_no>> p, shared_ptr<vector<string>> f): sought(s), lines(p), file(f) { }
Reading the name of the function from right to left, we see that we are defining the constructor for class QueryResult, which is nested in the scope of ...
Read now
Unlock full access