简体   繁体   中英

How can I find out the version of given / installed Boost headers?

Looking at a folder containing Boost headers I would like to find out which version of Boost that is.

Libraries have such information embedded inside or in their name. That's great. But I wonder how to find that out with a header only-folder of Boost? Which Boost documentation should I resort to, when using it?

I could, as a last resort, look at the date of creation of the files on the filesystem and guess that they cannot be part of any later Boost releases. Pfft. Someone can help?

(No, I would not have the option to "just replace that and update it to most recent / know version".)

Checkout version.hpp in the root include/ folder:

#define BOOST_LIB_VERSION "1_50_0"

This is the version number, with the dots replaced by underscores (here 1.50.0).

If you want to check compatibility automatically inside your header files, there is a numerical field, too:

//  BOOST_VERSION % 100 is the sub-minor version
//  BOOST_VERSION / 100 % 1000 is the minor version
//  BOOST_VERSION / 100000 is the major version

#define BOOST_VERSION 105000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM