Namespaces

This section describes the Intel® Threading Building Blocks (Intel® TBB) namespace conventions.

tbb Namespace

Namespace tbb contains public identifiers defined by the library that you can reference in your program.

tbb::flow Namespace

Namespace tbb::flow contains public identifiers defined by the library that you can reference in your program related to the flow graph feature. See Flow Graph for more information .

tbb::interfacex Namespace

Namespaces of the form tbb::interfacex define public identifiers that the library injects into namespace tbb. The numeral x corresponds to an internal version number that serves to prevent accidental linkage of incompatible definitions. Your code should never directly reference namespaces prefixed with tbb::interfacex. Instead, reference names via namespace tbb.

For example the header tbb/concurrent_hash_map.h defines the template concurrent_hashmap<Key,T> as tbb::version4::concurrent_hashmap<Key,T> and employs a using directive to inject it into namespace tbb. Your source code should reference it as tbb::concurrent_hashmap<Key,T>.

tbb::internal Namespace

Namespace tbb::internal serves a role similar to tbb::interfacex. It is retained for backwards compatibility with older versions of the library. Your code should never directly reference namespace tbb::internal. Indirect reference via a public typedef provided by the header files is permitted.

tbb::deprecated Namespace

The library uses the namespace tbb::deprecated for deprecated identifiers that have different default meanings in namespace tbb. Compiling with TBB_DEPRECATED=1 causes such identifiers to replace their counterpart in namespace tbb.

tbb::strict_ppl Namespace

The library uses the namespace tbb::strict_ppl for identifiers that are put in namespace Concurrency when tbb/compat/ppl.h is included.

std Namespace

The library implements some C++11 features in namespace std. The library version can be used by including the corresponding header in the following table.

C++11 Features Optionally Defined by Intel TBB.

Header

Identifiers Added to std::

Section

tbb/compat/condition_variable

defer_lock_t

try_to_lock_t

adopt_lock_t

defer_lock

try_to_lock

adopt_lock

lock_guard

unique_lock

swap

condition_variable

cv_status

timeout

no_timeout

C++11 Synchronization

tbb/compat/thread

thread

this_thread

thread Class

To prevent accidental linkage with other implementations of these C++ library features, the library defines the identifiers in other namespaces and injects them into namespace std::.  This way the “mangled name” seen by the linker will differ from the “mangled name” generated by other implementations.

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