Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Introspection library by Edward Diener starts tomorrow Friday 1
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-07-03 11:58:11


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




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk