Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-04-22 12:57:55


"Jody Hagins" <jody-boost-011304_at_[hidden]> wrote

> I still do
> not see how you can solve your problem with an integral constant that
> changes between compilation units. As I understnad, even Paul's COUNTER
> gets reset for each compilation unit so there is no guarantee that you
> will get the same value across compilation units, and this could cause
> problems between object modules and libraries.

You may be right. I don't see any problems with compilation because
encoding/decoding are parts of the same "typeof", and therefore always
happen in the same compilation unit, and if different constants are used in
different compilation units for the same type, it's probably OK. However
there might be linker problems when the same template specialisation, say
decode<mpl::int_<1> >, has different bodies. I admit, I did not check for
this. I kind of hope maybe this will be discarded by the linker before the
conflict gets discovered, since the class doesn't have any runtime stuff in
it. However, if it's not the case, you are right, this won't work :(

The ideal would be to somehow convert the file name in a number, and use it
in conjunction with the line number, but it doesn't seem possible...

Regards,
Arkadiy


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