class to ensure cacheline-aligned storage for an object. More...
#include <taskflow/utility/os.hpp>
Public Member Functions | |
| T & | get () |
| accesses the underlying object | |
| const T & | get () const |
| accesses the underlying object as a constant reference | |
Public Attributes | |
| T | data |
| The stored object, aligned to twice the cacheline size. | |
class to ensure cacheline-aligned storage for an object.
| T | The type of the stored object. |
This utility class aligns the stored object data to twice the size of a cacheline. The alignment improves performance by optimizing data access in cache-sensitive scenarios.
|
inline |
accesses the underlying object
Returns a mutable reference to the stored object so it can be read or written directly without copying.
|
inline |
accesses the underlying object as a constant reference
Returns a read-only reference to the stored object, for use on const-qualified instances of CachelineAligned.