Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor]:issues with expansion.
From: Littlefield, Tyler (tyler_at_[hidden])
Date: 2012-12-19 18:58:33


hello all:
I have the following code:
#define REGISTER_MODULE(module)(\
#ifdef BOOST_PP_EQUAL(BOOST_PP_LIST_SIZE(MODULES), 0)\
//there are currently no modules in the list.
#define MODULES((module), BOOST_PP_NIL)
#else
BOOST_PP_LIST_APPEND(MODULES, module)\
#endif
)

I am somewhat of a newb at preprocessor magic, so any advice would be
useful. For whatever reason this translates out to 'module)' when I try
to compile it with -E -P.
The idea is that it will add to the modules list (assuming the modules
list exists) the module to be registered, which should just be a type.
Thanks,

-- 
Take care,
Ty
http://tds-solutions.net
The aspen project: a barebones light-weight mud engine:
http://code.google.com/p/aspenmud
He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.

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