Feature Macros

Macros in this section control optional features in the library.


The macro TBB_DEPRECATED controls deprecated features that would otherwise conflict with non-deprecated use. Define it to be 1 to get deprecated Intel® Threading Building Blocks (Intel® TBB) 2.1 interfaces.


The macro TBB_USE_EXCEPTIONS controls whether the library headers use exception-handling constructs such as try, catch, and throw. The headers do not use these constructs when TBB_USE_EXCEPTIONS=0.

For the Microsoft Windows*, Linux*, and macOS* operating systems, the default value is 1 if exception handling constructs are enabled in the compiler, and 0 otherwise.


The runtime library may still throw an exception when TBB_USE_EXCEPTIONS=0.


The macro TBB_USE_CAPTURED_EXCEPTION controls rethrow of exceptions within the library. Because C++03 does not support catching an exception on one thread and rethrowing it on another thread, the library sometimes resorts to rethrowing an approximation called tbb::captured_exception.

  • Define TBB_USE_CAPTURED_EXCEPTION=1 to make the library rethrow an approximation. This is useful for uniform behavior across platforms.

  • Define TBB_USE_CAPTURED_EXCEPTION=0 to request rethrow of the exact exception. This setting is valid only on platforms that support the std::exception_ptr feature of C++11. Otherwise a compile-time diagnostic is issued.

On Windows* , Linux* and macOS* operating systems, the default value is 1 for supported host compilers with std::exception_ptr, and 0 otherwise. On IA-64 architecture processors the default value is 0.


In order for exact exception propagation to work properly an appropriate library binary should be used.

C++11 Support

To enable functionality that requires C++11, you need to use a compiler that supports C++11 mode, and compile your code with this mode set. C++11 support is off by default in the compiler. The following table shows the option for turning it on.

Compilation Commands for Setting C++11 Support


Intel® C++ Compiler

Compilation Command and Option

Windows* OS systems

icl /Qstd=c++11 foo.cpp

Linux* OS systems

macOS* systems

icc -std=c++11 foo.cpp

In some cases Intel TBB headers cannot correctly detect availability of necessary C++11 features in a C++ standard library. For example, when GNU libstdc++ library is used with a compiler that does not set GCC version macros (__GNUC__ etc.) or, like Clang, sets them to a version that does not match the version of libstdc++.

The macro TBB_USE_GLIBCXX_VERSION can be used to specify the proper version of GNU libstdc++ if the detection fails. Define the value of the macro equal to Major*10000 + Minor*100 + Patch, where Major.Minor.Patch is the actual GCC/libstdc++ version (if unknown, it can be obtained with 'gcc -dumpversion' or 'gcc -dumpfullversion' commands). For example, if you use libstdc++ from GCC 4.9.2, define TBB_USE_GLIBCXX_VERSION=40902. If you use GCC/libstdc++ of version 7 and higher, this macro is unnecessary and might be silently ignored by TBB.

See Also

For more complete information about compiler optimizations, see our Optimization Notice.