Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2007-03-02 13:04:02


>> where I don't really care what the specific order is, just that the
>> ordinal values are unique... Anyone have a bright idea on how to
>> accomplish this? Preprocessor?
>
> Yes, the preprocessor can be used. VC++ has a __COUNTER__
> extension. Also
> there is BOOST_PP_COUNTER/BOOST_PP_UPDATE_COUNTER()(introduced in
> 1.34).
>
> One problem -- if this used in different headers, the generated
> numbers
> depend on the order of includes, which potentially can lead to the ODR
> violation :-(

Sigh. This seems like something that ought to get language support...

> I once thought that the problem may be solved by compile-time GUID,
> but for
> me four numbers instead of one didn't work... but if you want
> _anything_
> less_than_comparable, this might be an option.

I'm not familiar with compile-time GUIDs - where is this discussed?

Matthias


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