The idea behind BOOST_JOIN is to force the preprocessor to scan the macro parameters for replacement before merging the results with ##. So, it changes the meaning if one of the parameters is a macro: #define Z_BOOST_JOIN(X, Y) X##Y Z_BOOST_JOIN(id_, __LINE__) // Expands to "id___LINE__" BOOST_JOIN(id_, __LINE__) // Expands to "id_13" if __LINE__ is 13
However, I'm not sure why BOOST_DO_JOIN2 is used; it seems to me that only one layer of indirection should work. I assume it's to work around some compiler's non-conforming preprocessor.
I think it depends on whether BOOST_JOIN is called from another macro or not (if not you need the extra indirection), or at least I think that's the answer ;-) John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm