9 May
2007
9 May
'07
3:05 p.m.
Ares Lagae wrote:
I have a list of fundamental types (known at compile time). For each of these types I want to declare a templated member in a class.
So, instead of
class foo { private: int int_variable; double double_variable; ... /* rest of types */ };
I want something like
class foo { private: variable_list
variable; }; and then access "foo::variable" with a template-like syntax. E.g. "variable.get<int>()".
Does anyone have any idea how I can accomplish this?
Hi, you could try: Boost.Fusion (only in CVS) or Boost.Tuple (http://boost.org/libs/tuple/doc/tuple_users_guide.html). -- HTH, dave