Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ policy.hpp中的Boost编译错误_C++ - Fatal编程技术网

C++ policy.hpp中的Boost编译错误

C++ policy.hpp中的Boost编译错误,c++,C++,对于我的项目,我正在尝试将boost库从1.39升级到1.58 编译时,我会遇到以下错误: home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:708:17:错误:预期标识符在“double”之前 /home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:708:17:错误:“参

对于我的项目,我正在尝试将boost库从1.39升级到1.58

编译时,我会遇到以下错误:

home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:708:17:错误:预期标识符在“double”之前 /home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:708:17:错误:“参数”声明中有两种或更多数据类型 /home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:709:8:错误:没有“policy”的默认参数 /home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:715:32:错误:“模板结构boost::math::policies::evaluation”的模板参数列表中参数1的类型/值不匹配 /home/kunehah/third_party/boost_1_58/prefix/include/boost/math/policies/policy.hpp:715:32:错误:应为“”类型的常量,获得“float”

我的
policy.hpp
文件如下:

//
// Traits class to handle internal promotion:
//
template <class Real, class Policy>//**line 708**
struct evaluation
{
   typedef Real type;
};

template <class Policy>
struct evaluation<float, Policy>//line 715**
{
   typedef typename mpl::if_<typename Policy::promote_float_type, double, float>::type type;
};

template <class Policy>
struct evaluation<double, Policy>
{
   typedef typename mpl::if_<typename Policy::promote_double_type, long double, double>::type type;
};

#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS

template <class Real>
struct basic_digits : public mpl::int_<0>{ };
template <>
struct basic_digits<float> : public mpl::int_<FLT_MANT_DIG>{ };
template <>
struct basic_digits<double> : public mpl::int_<DBL_MANT_DIG>{ };
template <>
struct basic_digits<long double> : public mpl::int_<LDBL_MANT_DIG>{ };
//
//处理内部晋升的Traits类:
//
模板//**第708行**
结构评估
{
typedef实型;
};
模板
结构评估//第715行**
{
typedef typename mpl::if_::type type;
};
模板
结构评估
{
typedef typename mpl::if_::type type;
};
#ifdef BOOST_NO_LIMITS_COMPILE_TIME_常量
模板
结构基本数字:公共mpl::int{};
模板
结构基本数字:公共mpl::int{};
模板
结构基本数字:公共mpl::int{};
模板
结构基本数字:公共mpl::int{};

请帮助我理解这些错误。

请将您的代码发布为生成错误消息的。您使用的编译器是什么?看起来您有一个邪恶的定义,其大意是
#define Real double
。找到这一点,带着极大的偏见消除它。