Please see the scenario below...am I doing something wrong or is this a gcc or multiprecision bug?


Thanks,

Rob Conde



given the following code (multiPrecisionTest.cpp):


#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_bin_float.hpp>

typedef boost::multiprecision::int128_t int128_t;
typedef boost::multiprecision::cpp_bin_float_quad float128_t;

int main()
{
   int128_t intVal;
   float128_t floatVal(intVal.convert_to<float128_t>());
   
   return 0;
}

--------------------------------------------------------------------------

g++ -std=c++0x -c multiPrecisionTest.cpp


I get the following error:


In file included from ./boost/multiprecision/cpp_int.hpp:1936:0,
                 from multiPrecisionTest.cpp:1:
./boost/multiprecision/cpp_int/misc.hpp: In instantiation of ‘typename boost::enable_if_c<(boost::multiprecision::backends::is_trivial_cpp_int<boost::multiprecision::backends::cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && boost::multiprecision::is_signed_number<boost::multiprecision::backends::cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value)>::type boost::multiprecision::backends::eval_convert_to(R*, const boost::multiprecision::backends::cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>&) [with R = boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<113u, (boost::multiprecision::backends::digit_base_type)2u, void, short int, -16382, 16383>, (boost::multiprecision::expression_template_option)0u>; unsigned int MinBits1 = 128u; unsigned int MaxBits1 = 128u; boost::multiprecision::cpp_integer_type SignType1 = (boost::multiprecision::cpp_integer_type)1u; boost::multiprecision::cpp_int_check_type Checked1 = (boost::multiprecision::cpp_int_check_type)0u; Allocator1 = void; typename boost::enable_if_c<(boost::multiprecision::backends::is_trivial_cpp_int<boost::multiprecision::backends::cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value && boost::multiprecision::is_signed_number<boost::multiprecision::backends::cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value)>::type = void]’:
./boost/multiprecision/number.hpp:585:40:   required from ‘void boost::multiprecision::number<Backend, ExpressionTemplates>::convert_to_imp(T*) const [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<113u, (boost::multiprecision::backends::digit_base_type)2u, void, short int, -16382, 16383>, (boost::multiprecision::expression_template_option)0u>; Backend = boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)1u, (boost::multiprecision::cpp_int_check_type)0u, void>; boost::multiprecision::expression_template_option ExpressionTemplates = (boost::multiprecision::expression_template_option)0u]’
./boost/multiprecision/number.hpp:601:29:   required from ‘T boost::multiprecision::number<Backend, ExpressionTemplates>::convert_to() const [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<113u, (boost::multiprecision::backends::digit_base_type)2u, void, short int, -16382, 16383>, (boost::multiprecision::expression_template_option)0u>; Backend = boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)1u, (boost::multiprecision::cpp_int_check_type)0u, void>; boost::multiprecision::expression_template_option ExpressionTemplates = (boost::multiprecision::expression_template_option)0u]’
multiPrecisionTest.cpp:10:54:   required from here
./boost/multiprecision/cpp_int/misc.hpp:533:138: error: no type named ‘type’ in ‘struct boost::common_type<boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<113u, (boost::multiprecision::backends::digit_base_type)2u, void, short int, -16382, 16383>, (boost::multiprecision::expression_template_option)0u>, __int128 unsigned>’
    typedef typename common_type<R, typename cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::local_limb_type>::type common_type;
                                                                                                                                          ^