Is it possible to store a type name as a C++ variable? For example, like this:
type my_type = int; // or string, or Foo, or any other type void* data = ...;
Yes, if you code it yourself.
enum Foo_Type{ AFOO, B_AFOO, C_AFOO, RUN }; struct MyFoo{ Foo_Type m_type; Boost::shared_ptr m_foo; }
as commented below, what I left out was that all these "foo" types would have to be related to Foo. Foo would, in essence, be your interface.