Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2007-06-14 11:46:24


"Douglas Gregor" <dgregor_at_[hidden]> wrote in message
> Arkadiy Vertleyb wrote:
>> Another example (from the Typeof library):
>>
>> Types and templates are mapped to unique numbers using preprocessor
>> counter.
>> The resulting specializations depend on the order these specializations
>> are
>> seen by the preprocessor, and therefore on the order of inclusion.
>>
> The Typeof library is a great thing, but the techniques needed to
> simulate what should be a language feature are C++ hacks. We don't need
> to loosen or fix the ODR, we need the functionality that the Typeof
> library provides ("give me the type of this expression!") to be in the
> language. decltype fixes that.

I did not suggest that C++ standard should be fixed to make the Typeof
library 100% compliant ;-)

My point was to mention the technique used; this technique (generating
template specializations on demand, and maybe using preprocessor counter to
give them unique numbers) might be useful in other contexts...

Or it might be not.

Regards,
Arkadiy


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