Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-12-29 13:06:50


"Arkadiy Vertleyb" <vertleyb_at_[hidden]> wrote in message
news:dov01a$hjb$1_at_sea.gmane.org...
> "Cromwell Enage" <sponage_at_[hidden]> wrote
>
> > * The BOOST_MPL_AUX_TYPEOF_REGISTER_TYPE_C macro,
> > defined in
> > <boost/mpl/aux_/typeof/register_type_c.hpp>
>
> Hmmm, I am kind of surprised it is working...

Now I understand why it works (at least on MSVC), and this is a typeof bug,
unfortunately, since it gives you a false sence of security while working
with this compiler, but the same code (I am pretty sure) will not compile
with other compilers.

The reason is that I decided to use MS-specific __COUNTER__ macro for MSVC,
and this macro works differently from BOOST_PP_COUNTER which is used for
other compilers, so much different, it turned, that it hid the problem. I
will have to start using BOOST_PP_COUNTER for MSVC.

Once I change this, the code that repeats BOOST_TYPEOF_REGISTER_[...] via
BOOST_PP_SEQ_ENUM, BOOST_PP_REPEAT, etc., will stop compiling on MSVC (as it
is not compiling on other compilers now) since it will use the same IDs for
all elements of the sequence.

A way to deal with this would be to explicitly supply IDs (see
http://article.gmane.org/gmane.comp.lib.boost.devel/136147/match=typeof for
an example), but for this I will have to add one macro to typeof.

As far as BOOST_PP_ENUM reentrancy is concerned, we only use this macro with
template template parameters, so if you don't care about them your code
should be fine. I'll see what can be done to make the typeof registration
usable with all the Boost PP looping constructs.

Regards,
Arkadiy


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