Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-09-13 09:48:19


----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, September 13, 2002 11:11 AM
Subject: Re: [boost] MPL with mipspro

> From: "Douglas Gregor" <gregod_at_[hidden]>
>
>
> > On Friday 13 September 2002 09:50 am, David Abrahams wrote:
> > > These old EDG compilers have problems with ice's. It usually makes
> sense to
> > > compute them separately:
> > >
> > > BOOST_STATIC_CONSTANT(T, next_value = value + 1);
> > > typedef integral_c<T, next_value> next;
> >
> > Doesn't this version break on Borland?
>
> Probably.
>
Yes, it does.
However, the usual workaround is to write it like this:

template<class T>
struct X
{
  BOOST_STATIC_CONSTANT(T, next_value = value + 1);
   typedef integral_c<T, BOOST_MPL_AUX_VALUE_WKND<X>::next_value> next;
}

That is, always use the workaround macro when refering to a local value.
The macro is defined in: mpl\aux_\value_wknd.hpp

> > > or simply parenthesize:
> > >
> > > typedef integral_c<T, (value + 1)> next;
> >
> > I thought this was the only 'portable' was to handle ICEs...
>
For Borland, this has the same problem as using 'next_value' directly. i.e,
'value' is local.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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