Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2005-03-01 04:59:36


Jeff Garland writes:
> I realize this is an experimental compiler, but I notice date-time
> isn't building because of an MPL failure. Similar problem in the
> MPL tests. I looked at the code, but I have no idea what the
> problem could be, possibly something simple?

Just looked into it, and it appears to be a GCC bug: they seem to
disallow any cast notation in integral constant expressions, while
section 5.19 [expr.const] para 1 explicitly allows type conversions to
integral or enumeration types:

  [...] Floating literals (2.13.3) can appear only if they are cast to
  integral or enumeration types. Only type conversions to integral or
  enumeration types can be used. [...]

If you could verify that the following stripped down version of the
code in question is rejected, I'd submit a corresponding bug report:

    template< int n > struct int_ {};
    typedef int_< static_cast<int>(5) > n;

-- 
Aleksey Gurtovoy
MetaCommunications Engineering

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