Boost logo

Boost Users :

Subject: Re: [Boost-users] Using different variables based on template type
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-06-03 01:45:11


Scott McMurray wrote:
> So you want a way where you have an MPL typelist of the types, and
> just adding a type to that typelist is all you need to do. (Or to a
> PP sequence, or ...
Being able just add a type to a typelist and then have the appropriate
helper functions generated would be nice but not a necessary. So far
I'm having to put some logic functions into my helper functions.

void putUint16(std::string const& variableName, uint16 const variable) {
    m_CurrentStructure->remove(variableName);
   //This function call is duplicated in every helper function.
    m_CurrentStructure->m_Uint16Map[variableName] = variable; //This
is needed in every helper function but the appropriate map is needs to
be used.
}

Since all these helper functions are exactly the same except the map
being called I was hoping to refactor to allow adding new type more easily.

By the way, what is a PP sequence?

Ryan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net