|
Boost Users : |
Subject: [Boost-users] Cannot compile with multiprecision :: eval_*() functions
From: Anderson Lebowski (apartment.26688_at_[hidden])
Date: 2014-01-20 04:10:56
Hi folks,
I am trying to use eval_pow() and eval_powm()
My code is like this and I am using Visual Studio 12:
#include <boost/multiprecision/cpp_int.hpp>
...
boost::multiprecision::cpp_int pow("1234567");
boost::multiprecision::cpp_int base(3);
boost::multiprecision::cpp_int result = 0;
boost::multiprecision::default_ops::eval_pow(result, base, pow);
I cannot figure out what's going on wrong when I compile it, the error
message is like the following, Can anyone shed some light please?
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(146):
error C2039: 'unsigned_types' : is not a member of
'boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<0,0,signed_magnitude,unchecked,std::allocator<boost::multiprecision::limb_type>>,et_on>'
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(191)
: see reference to class template instantiation
'boost::multiprecision::detail::canonical_imp<Val,Backend,boost::mpl::int_<1>>'
being compiled
1> with
1> [
1> Val=unsigned char
1> , Backend=double_type
1> ]
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/integer_ops.hpp(309)
: see reference to class template instantiation
'boost::multiprecision::detail::canonical<unsigned char,double_type>' being
compiled
1> KeyGen.cpp(152) : see reference to function template
instantiation 'void
boost::multiprecision::default_ops::eval_powm<boost::multiprecision::cpp_int,int>(Backend
&,const Backend &,const Backend &,Integer)' being compiled
1> with
1> [
1> Backend=boost::multiprecision::cpp_int
1> , Integer=int
1> ]
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(146):
error C2146: syntax error : missing ',' before identifier 'unsigned_types'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(146):
error C2065: 'unsigned_types' : undeclared identifier
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(148):
error C2977: 'boost::mpl::find_if' : too many template arguments
1> D:\Develop\C++\boost_1_55_1\boost/mpl/find_if.hpp(33) : see
declaration of 'boost::mpl::find_if'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(148):
error C2955: 'boost::mpl::find_if' : use of class template requires
template argument list
1> D:\Develop\C++\boost_1_55_1\boost/mpl/find_if.hpp(33) : see
declaration of 'boost::mpl::find_if'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(136):
error C2039: 'signed_types' : is not a member of
'boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<0,0,signed_magnitude,unchecked,std::allocator<boost::multiprecision::limb_type>>,et_on>'
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(191)
: see reference to class template instantiation
'boost::multiprecision::detail::canonical_imp<Val,Backend,boost::mpl::int_<0>>'
being compiled
1> with
1> [
1> Val=int
1> , Backend=double_type
1> ]
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/integer_ops.hpp(310)
: see reference to class template instantiation
'boost::multiprecision::detail::canonical<Integer,double_type>' being
compiled
1> with
1> [
1> Integer=int
1> ]
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(136):
error C2146: syntax error : missing ',' before identifier 'signed_types'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(136):
error C2065: 'signed_types' : undeclared identifier
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(138):
error C2977: 'boost::mpl::find_if' : too many template arguments
1> D:\Develop\C++\boost_1_55_1\boost/mpl/find_if.hpp(33) : see
declaration of 'boost::mpl::find_if'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/number_base.hpp(138):
error C2955: 'boost::mpl::find_if' : use of class template requires
template argument list
1> D:\Develop\C++\boost_1_55_1\boost/mpl/find_if.hpp(33) : see
declaration of 'boost::mpl::find_if'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/integer_ops.hpp(336):
error C2780:
'enable_if<boost::multiprecision::backends::is_trivial_cpp_int<boost::multiprecision::backends::cpp_int_backend<MinBits,MaxBits,SignType,Checked,Allocator>>,void>::type
boost::multiprecision::backends::eval_right_shift(boost::multiprecision::backends::cpp_int_backend<MinBits,MaxBits,SignType,Checked,Allocator>
&,T)' : expects 2 arguments - 1 provided
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/cpp_int/bitwise.hpp(355) :
see declaration of 'boost::multiprecision::backends::eval_right_shift'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/integer_ops.hpp(336):
error C2780:
'enable_if_c<!boost::multiprecision::backends::is_trivial_cpp_int<boost::multiprecision::backends::cpp_int_backend<MinBits,MaxBits,SignType,Checked,Allocator>>::value,void>::type
boost::multiprecision::backends::eval_right_shift(boost::multiprecision::backends::cpp_int_backend<MinBits,MaxBits,SignType,Checked,Allocator>
&,boost::multiprecision::double_limb_type)' : expects 2 arguments - 1
provided
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/cpp_int/bitwise.hpp(298) :
see declaration of 'boost::multiprecision::backends::eval_right_shift'
1>D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/integer_ops.hpp(336):
error C2780: 'void boost::multiprecision::default_ops::eval_right_shift(T
&,const T &,const V)' : expects 3 arguments - 1 provided
1>
D:\Develop\C++\boost_1_55_1\boost/multiprecision/detail/default_ops.hpp(758)
: see declaration of 'boost::multiprecision::default_ops::eval_right_shift'
------------------------------
Thanks,
-Anderson Lebowski
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