I'm using the Boost Parameter tutorial to create a named-parameter constructor for a playing card generator. The tutorial says to put the ArgumentPack into a base class, but I want to modify variables in the card generator class. I've thought about doing this:
class CGconstructor_base {
public:
template<class ArgumentPack>
CGconstructor_base(ArgumentPack const& args);/*tutorial says to put code
in this function */
friend CardGenerator;//so it can modify the variables of CardGenerator
}
class CardGenerator:public CGconstructor_base;
Is this legal or is there a better way to manipulate the private variables in CardGenerator and use Boost Parameter library? OS: Windows XP Pro, Compilier: Visual C++ 2008 Express,Boost: 1.39.0