Declare a thread‐local static variable at function or namespace scope.

Synopsis

Declared in <bslmt_threadlocalvariable.h>

#define BSLMT_THREAD_LOCAL_VARIABLE(BASIC_TYPE, VARIABLE_NAME, INITIAL_VALUE)

Description

Define, at function or namespace scope, a thread‐local static variable having the specified VARIABLE_NAME of the specified BASIC_TYPE, initialized with the specified INITIAL_VALUE. If VARIABLE_NAME is not a valid variable name, or INITIAL_VALUE is not convertible to the type BASIC_TYPE, the instantiation of this macro will result in a compile time error. The behavior is undefined unless INITIAL_VALUE is a compile time constant value.

Parameters

Name

Description

BASIC_TYPE

fundamental or pointer type of the variable

VARIABLE_NAME

name of the thread‐local static variable

INITIAL_VALUE

compile‐time constant initial value

Created with MrDocs