
2012/11/9 Mathias Gaunard <mathias.gaunard@ens-lyon.org>:
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