
AMDG On 07/03/2011 08:17 AM, Mathias Gaunard wrote:
On 07/03/2011 02:21 PM, Edward Diener wrote:
My intention, evidently misguided, was to put the generated metafunctions in the boost::tti namespace to avoid polluting the global namespace. But I see now that I should not have added a namespace at all and the end-user could then use the macros in whatever namespace he wants in order to avoid ODR violations, and/or just use the complicated macro form to create a unique name for the metafunction. Actually, of course, that still could be done, but a full metafuncion name of 'anamespace::boost::tti::has_type_mytype' is more gruesome than 'anamespace::has_type_mytype'.
Thanks for pointing this out.
How about checking with the preprocessor if the meta-function has already been defined, and not defining it in that case?
That isn't possible. The only way to indicate to the preprocessor that the metafuction has been defined is to define a macro, and a macro can't define another macro. In Christ, Steven Watanabe