[#BSLMT_THREAD_LOCAL_VARIABLE]
= BSLMT&lowbar;THREAD&lowbar;LOCAL&lowbar;VARIABLE
:mrdocs:

Declare a thread&hyphen;local static variable at function or namespace scope&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;threadlocalvariable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
#define BSLMT&lowbar;THREAD&lowbar;LOCAL&lowbar;VARIABLE(BASIC&lowbar;TYPE, VARIABLE&lowbar;NAME, INITIAL&lowbar;VALUE)

----

== Description

Define, at function or namespace scope, a thread&hyphen;local `static` variable having the specified `VARIABLE&lowbar;NAME` of the specified `BASIC&lowbar;TYPE`, initialized with the specified `INITIAL&lowbar;VALUE`&period; If `VARIABLE&lowbar;NAME` is not a valid variable name, or `INITIAL&lowbar;VALUE` is not convertible to the type `BASIC&lowbar;TYPE`, the instantiation of this macro will result in a compile time error&period; The behavior is undefined unless `INITIAL&lowbar;VALUE` is a _compile_ _time_ constant value&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *BASIC&lowbar;TYPE*
| fundamental or pointer type of the variable
| *VARIABLE&lowbar;NAME*
| name of the thread&hyphen;local static variable
| *INITIAL&lowbar;VALUE*
| compile&hyphen;time constant initial value
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
