|
Boost : |
From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-12-15 09:24:59
Rani Sharoni wrote:
>>Just curious:
>>
>>struct A;
>>typedef int test[is_incomplete<A>::value];
>>struct A {};
>>typedef int test[!is_incomplete<A>::value];
>>
>>Does this work, too? (Can't check it myself currently...)
>
> Completing class A yield undefined behavior since the completeness of the
> type should not affect overload resolution. This makes my implementation
> undefined by definition :).
> Nevertheless diagnostic is not required and this is basic "assumption" of
> the is_incomplete "designers".
>
> The above code is also ill-formed since POI in unique in each translation
> unit.
I didn't asked if it is legal, because I know that it is illegal. The
question is, whether it works or not. I think the answer to this
question might teach me something about how compilers work, i.e. whether
the type information that is used to find a templates instantiation
contains the completeness of a template parameter or not. I guess it
won't work...
Don't know if this knowledge can be used for anything, but as mentioned:
I'm just curious... :)
Regards, Daniel
-- Daniel Frey aixigo AG - financial solutions & technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk