
"Paul Mensonides" <pmenso57@comcast.net> wrote in message news:002c01c40245$4f522900$6401a8c0@c161550b...
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Jonathan Turkanis
When you pass EMPTY() as an argument to IF, it expands to nothing before the replacement list is rescanned, yielding:
Somehow I thought EMPTY() would be lazier. I guess it can't be that smart -- it wouldn't know how lazy to be.
#define PARAM(has_param) \ BOOST_PP_IF( \ BOOST_PP_IDENTITY(typename Param), \ BOOST_PP_EMPTY \ )() \ /**/
// or: // #define PARAM(has_param) \ // BOOST_PP_EXPR_IF(has_param, typename Param) \ // /**/
#define MACRO(has_param) \ template< \ PARAM(has_param) BOOST_PP_COMMA_IF(has_param) \ typename T> \ struct name { }; \ /**/
I like the first better because it's self-contained. Thanks for your patience with my preprocessor naïveté. Jonathan