这都是什么错误

2023-07-08 14:39:47 浏览数 (1)

将版本v142改成v140就出现了这个问题

代码语言:javascript复制
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(405): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(406): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(413): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(414): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(415): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(495): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(500): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(500): note: 请参见“--”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(502): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(502): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(503): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(503): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(504): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(504): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(505): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(505): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(506): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(506): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(508): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(508): note: 请参见“  ”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(493): error C3259: “constexpr”函数只能有一个 return 语句
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(515): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(520): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(520): note: 请参见“--”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(522): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(522): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(523): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(523): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(524): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(524): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(525): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(525): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(526): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(526): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(527): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(527): note: 请参见“|=”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(529): error C3249: “constexpr”函数的语句或子表达式非法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(529): note: 请参见“  ”的用法
1>D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82boost/core/bit.hpp(513): error C3259: “constexpr”函数只能有一个 return 语句

出问题的都是类似这种 x = x - ( ( x >> 1 ) & 0x55555555 );

代码语言:javascript复制
BOOST_CXX14_CONSTEXPR inline int popcount_impl( boost::uint32_t x ) BOOST_NOEXCEPT
{
    x = x - ( ( x >> 1 ) & 0x55555555 );
    x = ( x & 0x33333333 )   ( ( x >> 2 ) & 0x33333333 );
    x = ( x   ( x >> 4 ) ) & 0x0F0F0F0F;

    return static_cast<unsigned>( ( x * 0x01010101 ) >> 24 );
}
代码语言:javascript复制
BOOST_CXX14_CONSTEXPR inline int popcount_impl( boost::uint64_t x ) BOOST_NOEXCEPT
{
    x = x - ( ( x >> 1 ) & 0x5555555555555555 );
    x = ( x & 0x3333333333333333 )   ( ( x >> 2 ) & 0x3333333333333333 );
    x = ( x   ( x >> 4 ) ) & 0x0F0F0F0F0F0F0F0F;

    return static_cast<unsigned>( ( x * 0x0101010101010101 ) >> 56 );
}
代码语言:javascript复制
BOOST_CXX14_CONSTEXPR inline boost::uint32_t bit_ceil_impl( boost::uint32_t x ) BOOST_NOEXCEPT
{
    if( x == 0 )
    {
        return 0;
    }

    --x;

    x |= x >> 1;
    x |= x >> 2;
    x |= x >> 4;
    x |= x >> 8;
    x |= x >> 16;

      x;

    return x;
}

BOOST_CXX14_CONSTEXPR inline boost::uint64_t bit_ceil_impl( boost::uint64_t x ) BOOST_NOEXCEPT
{
    if( x == 0 )
    {
        return 0;
    }

    --x;

    x |= x >> 1;
    x |= x >> 2;
    x |= x >> 4;
    x |= x >> 8;
    x |= x >> 16;
    x |= x >> 32;

      x;

    return x;
}

改的是boost里面的头文件includeboost-1_82boostmathtools config

代码语言:javascript复制
#define BOOST_MATH_NO_MP_TESTS
//#if (__cplusplus > 201400L || _MSVC_LANG > 201400L)
#if (__cplusplus > 201402L || _MSVC_LANG > 201402L)
//#define BOOST_CXX14_CONSTEXPR constexpr
#define BOOST_CXX14_CONSTEXPR constexpr
#else
#define BOOST_CXX14_CONSTEXPR
#define BOOST_NO_CXX14_CONSTEXPR
#endif // BOOST_CXX14_CONSTEXPR

#if (__cplusplus > 201402L || _MSVC_LANG > 201402L) 直接跳过这个版本

0 人点赞