Pointers to Member in C
Introduction Suppose you have structures like this in C++: struct loc { std::string path; unsigned line, col; void print( std::ostream& ) const; }; struct symbol { //... loc dec_loc; // Location of declaration. loc def_loc; // Location of definition. }; and you want to iterate over a container…