I have a class which looks something like this. I'd prefer to have the typedef of ParentMember in the Parent class and rename it Member. How might this be possible? The only way I can see is to have std::vector as a public member instead of using inheritance.
typedef std::pair<std::string, boost::any> ParentMember;
class Parent: public std::vector<ParentMember>
{
public:
template <typename T>
std::vector<T>& getMember(std::string& s)
{
MemberFinder finder(s);
std::vector<ParentMember>::iterator member = std::find_if(begin(), end(), finder);
boost::any& container = member->second;
return boost::any_cast<std::vector<T>&>(container);
}
private:
class Finder
{
...
};
};