FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
task_local< T > Struct Template Reference

A global variable with a task-specific value. More...

Public Member Functions

T & operator* () &noexcept
 Get the current task's value.
 
T * operator-> () noexcept
 Access a member of the current task's value.
 
 task_local ()
 Create a task-local variable.
 
 task_local (task_local &&)=delete
 It would not be clear whether moving a task_local applied to the (current) value or the identity of the variable.
 

Detailed Description

template<class T>
struct flecsi::task_local< T >

A global variable with a task-specific value.

Must be constructed before calling start. The value for a task has the lifetime of that task; the value outside of any task has the lifetime of start. Each is value-initialized.

Note
Thread-local variables do not function correctly in all backends.

Constructor & Destructor Documentation

◆ task_local() [1/2]

template<class T >
task_local ( )

Create a task-local variable.

◆ task_local() [2/2]

template<class T >
task_local ( task_local< T > &&  )
delete

It would not be clear whether moving a task_local applied to the (current) value or the identity of the variable.

Member Function Documentation

◆ operator*()

template<class T >
T & operator* ( ) &
noexcept

Get the current task's value.

◆ operator->()

template<class T >
T * operator-> ( )
noexcept

Access a member of the current task's value.