Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-16 14:17:27


From: "Steve M. Robbins" <steven.robbins_at_[hidden]>

> Hi,
>
> There's a bit of code in there that reads
>
> // have to #ifdef here: some compilers don't like the 'N + 1' form
(MSVC),
> // while some other don't like 'value + 1' (Borland)
> #if !defined(__BORLANDC__)
> typedef integral_c<T, value + 1> next;
> typedef integral_c<T, value - 1> prior;
> #else
> typedef integral_c<T, N + 1> next;
> typedef integral_c<T, N - 1> prior;
> #endif
>
>
> The MIPSpro compiler (version 7.30, using -LANG:std) doesn't like either
form.
> Is there a third way?

First try adding parens around (value + 1).

Then try BOOST_STATIC_CONSTANT(type-of-value, next_val = value + 1), and
pass next_val to integral_c.

Let us know what works...

-Dave

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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