Boost logo

Boost :

Subject: Re: [boost] [type_traits] is_complete<T> possible realization
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2012-11-09 09:38:03


2012/11/9 Mathias Gaunard <mathias.gaunard_at_[hidden]>:
> On 05/11/2012 09:34, Antony Polukhin wrote:
>>
>> void foo1() {
>> cout
>> << is_complete<incomplete, __LINE__>::value
>> << is_complete<incomplete_template<0> , __LINE__>::value
>> << is_complete<incomplete_template<1> , __LINE__>::value
>> << is_complete<complete, __LINE__>::value
>> << is_complete<complete_abstract, __LINE__>::value
>> << endl;
>> }
>
>
>
> What if I do in another TU is_complete<incomplete, __LINE__> at the same
> line number and when incomplete is actually complete?

You can always add some more misc template parameters:

void foo1() {
    struct unique_foo1_tag;
    cout
            << is_complete<incomplete, __LINE__, unique_foo1_tag>::value
            << is_complete<incomplete_template<0> , __LINE__,
unique_foo1_tag>::value
            << is_complete<incomplete_template<1> , __LINE__,
unique_foo1_tag>::value
            << is_complete<complete, __LINE__, unique_foo1_tag>::value
            << is_complete<complete_abstract, __LINE__, unique_foo1_tag>::value
            << endl;
}

And you can also use __COUNTER__ on MSVC.

--
Best regards,
Antony Polukhin

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