Boost logo

Boost Users :

Subject: [Boost-users] [chrono] Intel Composer XE 2011 unable to compile chrono library
From: Edward Rankin (erankin_at_[hidden])
Date: 2011-07-05 22:28:38


Hi,

The purpose of this email is to get some insight on the problem we faced
when trying to compile chrono from the 1.47 Beta 1 package. I have tried
both the latest released compiler (2011 Update 4) and the current SP1 beta.
There is no issue with VS 2010 SP1's compiler.

It was first surfaced here:
http://comments.gmane.org/gmane.comp.lib.boost.user/68421. The error
received can be seen below:
< snip >
chrono.cpp
.\boost/chrono/duration.hpp(94): error: expected an expression
                  && (boost::is_convertible<Rep2,
                  ^

.\boost/chrono/duration.hpp(124): error: expected an expression
                  && (boost::is_convertible<Rep,
                  ^
< snip >

After some discussion with Vicente and some testing by me, it turns out that
Intel was not happy with the first operand of the && operator in the
following snippet of code:

template <class Duration, class Rep2,
        bool = (
                    (boost::is_convertible<typename Duration::rep,
                        typename common_type<typename Duration::rep,
Rep2>::type>::value)
                && (boost::is_convertible<Rep2,
                        typename common_type<typename Duration::rep,
Rep2>::type>::value)
                )
>
    struct duration_divide_imp
    {
    };

If we place an additional parenthesis around that first operand like this:

template <class Duration, class Rep2,
        bool = (
                    ( (boost::is_convertible<typename Duration::rep,
                        typename common_type<typename Duration::rep,
Rep2>::type>::value) )
                && (boost::is_convertible<Rep2,
                        typename common_type<typename Duration::rep,
Rep2>::type>::value)
                )
>
    struct duration_divide_imp
    {
    };

It will happily compile. It is rather bizarre that this is necessary, which
leads Vicente and I to believe that there is a bug in the Intel Compiler.
What do you guys think? I have also posted to the Intel forums, the thread
can be seen here:
http://software.intel.com/en-us/forums/showthread.php?t=84061

Regards,

Edward



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