In short, I would like to accomplish the following:
#define CLASS( C ) class C;
#define CLASSES( ... )
CLASSES( Foo, Bar, Golf ) // Expand: class Foo; class Bar; class Golf;
Is there any way to accomplish this using boost?
Currently, I have tried the following:
#include <boost/preprocessor/repetition/repeat.hpp>
#define CLASS( C ) class C;
#define CLASSES( N, ... ) BOOST_PP_REPEAT( N, CLASS, Name) // problem here
CLASSES( 3, Foo, Bar, Golf ) // Expand: class Name; class Name; class Name;
But I don't know how to incorporate __VA_ARGS__
in order to expand different names.
I am open to other suggestions, not strict on boost, but restricted to C++11.