Boost logo

Boost :

Subject: Re: [boost] [tti] compiler error: shadows template param `class T`
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-08-11 10:41:15


Edward Diener-3 wrote:
>
> On 8/10/2011 9:37 PM, Lorenzo Caminiti wrote:
>> Hello,
>>
>> The TTI library macros expand to code that uses naive template
>> parameter names like "T", "F", "U", etc. The library implementation
>> should be changed to use library reserved names to avoid clashing with
>> user template parameter names. For example, the library use a name
> This is a good suggestion, which I will implement. Thanks for bringing
> it up.
>

Thanks!

Also another thing, I don't remember if the docs explain the library
behavior with cv-qualified member functions-- I should probably go back and
read the docs instead of just asking you :) I did test cv-qualified member
function introspection and it seems to be working fine (as it should). If
it's not documented, can you please document it? The same would apply to
cv-qualified member data (which I didn't test).

For example:

struct C {
    void f () const {}
    void g () const volatile {}
};

BOOST_TTI_HAS_COMP_MEMBER_FUNCTION_TRAIT(has_f, f)

has_f< void (C::*)() >::value // 0
has_f< void (C::*)() const >::value // 1
has_f< void (C::*)() volatile >::value // 0
has_f< void (C::*)() const volatile >::value // 0

BOOST_TTI_HAS_MEMBER_FUNCTION_TRAIT(has_g, g)

has_g< C, void >::value // 0
has_g< C const, void >::value // 0
has_g< C volatile, void >::value // 0
has_g< C const volatile, void >::value // 1

Thanks.
--Lorenzo

--
View this message in context: http://boost.2283326.n4.nabble.com/tti-compiler-error-shadows-template-param-class-T-tp3734761p3736038.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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