The Boost project provides free peer-reviewed portable C++ source libraries.
We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use and does not require attribution for binary use.
The project website is www.boost.org, where you can obtain more information and download the current release.
Run:
$ npm i boost.cxxAnd then include boost/thread.hpp as follows:
// main.cxx
#include <boost/thread.hpp>
int main() { /* ... */ }Finally, compile while adding the path node_modules/boost.cxx to your compiler's include paths.
$ clang++ -std=c++17 -I./node_modules/boost.cxx main.cxx # or, use g++
$ g++ -std=c++17 -I./node_modules/boost.cxx main.cxxYou may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
$ cpoach clang++ -std=c++17 main.cxx # or, use g++
$ cpoach g++ -std=c++17 main.cxx