Boost logo

Boost Users :

Subject: Re: [Boost-users] [mpl] cross product and gcc specific compiler error
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-05-14 09:02:09


AMDG

On 05/13/2012 04:45 PM, Josh Quigley wrote:
> Hi,
>
> I grabbed an mpl cross product implementation (product_view) of this
> mailing list. It works fine in MSVC but fails in gcc:
>

It doesn't work because you're relying on
implementation details. Use boost::mpl::at_c<XXX, 0>::type
instead of XXX::item0.

> <snip>
> BOOST_AUTO_TEST_CASE_TEMPLATE(MyTest, DecimalIntegralT,
> EachDecimalWithEachIntegralT)
> {
> {
> typename DecimalIntegralT::item1 r(1234567); // Fails on
> gcc: no type named ‘item0’ in ‘struct boost::mpl::v_item<long long
> unsigned int, boost::mpl::v_item<ext::decimal::decimal128,
> boost::mpl::vector0<mpl_::na>, 0>, 0>
> typename DecimalIntegralT::item0 d(r);
>
> BOOST_CHECK_EQUAL(static_cast<long long>(d), r);
> }
> }
>
>

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net