Walter
Walter

Reputation: 45474

boost::multiprecision::float128 and C++11

I'm trying to use boost::multiprecision::float128 (boost 1.55.0) under C++11 (gcc 4.8.1), but get the following compiler error:

/cm/shared/apps/boost/gcc/1.55.0/include/boost/multiprecision/float128.hpp: In static member function ‘static std::numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ET> >::number_type std::numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ET> >::min()’:
/cm/shared/apps/boost/gcc/1.55.0/include/boost/multiprecision/float128.hpp:533:55: error: unable to find numeric literal operator ‘operator"" Q’
    static number_type (min)() BOOST_NOEXCEPT { return 3.36210314311209350626267781732175260e-4932Q; }

Can't I use boost::multiprecision::float128 in C++11? Or how else do I get it working?

edit

Just to clarify. This error is generated by

#include <boost/multiprecision/float128.hpp>

The compiler is not happy with the statement

return 3.36210314311209350626267781732175260e-4932Q;

in particular the Q is confusing it. I used the compiler flags -std=c++11 -fabi-version=0 -march=native -mfpmath=sse

Upvotes: 7

Views: 4388

Answers (1)

Cornstalks
Cornstalks

Reputation: 38238

It looks like a known issue. Try compiling with -fext-numeric-literals.

Upvotes: 17

Related Questions