How to determine the Boost version on a system?

前端 未结 12 2207
暖寄归人
暖寄归人 2020-12-04 07:46

Is there a quick way to determine the version of the Boost C++ libraries on a system?

12条回答
  •  渐次进展
    2020-12-04 08:06

    Tested with boost 1.51.0:

    std::cout << "Using Boost "     
              << BOOST_VERSION / 100000     << "."  // major version
              << BOOST_VERSION / 100 % 1000 << "."  // minor version
              << BOOST_VERSION % 100                // patch level
              << std::endl;
    

    Output: Using Boost 1.51.0

    Tested with boost versions 1.51.0 to 1.65.0

提交回复
热议问题