1

我只是通过包含 karma.hpp 得到这个 STATIC_ASSERT 失败:

In file included from /apps/boost/include/boost/math/special_functions/detail/round_fwd.hpp:12:0,
             from /apps/boost/include/boost/math/special_functions/math_fwd.hpp:26,
             from /apps/boost/include/boost/math/special_functions/fpclassify.hpp:19,
             from /apps/boost/include/boost/spirit/home/support/detail/sign.hpp:22,
             from /apps/boost/include/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp:22,
             from /apps/boost/include/boost/spirit/home/karma/numeric/bool_policies.hpp:16,
             from /apps/boost/include/boost/spirit/home/karma/numeric/bool.hpp:29,
             from /apps/boost/include/boost/spirit/home/karma/numeric.hpp:13,
             from /apps/boost/include/boost/spirit/home/karma.hpp:15,
             from /apps/boost/include/boost/spirit/include/karma.hpp:16,
             from /home/<my header file that includes boost/spirit/include/karma.hpp>
             from /home/<my other header file that includes the above>
/apps/boost/include/boost/math/tools/promotion.hpp: In instantiation of `struct boost::math::tools::promote_args<long double, float, float, float, float, float>':
/apps/boost/include/boost/math/special_functions/sign.hpp:114:50:   required from `int boost::math::signbit(T) [with T = long double]'
/apps/boost/include/boost/spirit/home/support/detail/sign.hpp:47:51:   required from `bool boost::spirit::detail::signbit(T) [with T = long double]'
/apps/boost/include/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp:130:47:   required from here
/apps/boost/include/boost/math/tools/promotion.hpp:141:10: error: invalid application of `sizeof' to incomplete type `boost::STATIC_ASSERTION_FAILURE<false>'

是什么赋予了?我能想到的最好的是静态断言可以防止在不支持的地方使用 long double。但是,我在其他地方使用了 long double ,这很好。

**编辑:Boost 的最新开发版本提供了一个修复。从 SVN 获取。

4

0 回答 0