Pigweed
C/C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Public Member Functions | List of all members
pw::NaturallyAligned< T > Struct Template Reference
Inheritance diagram for pw::NaturallyAligned< T >:

Public Member Functions

 NaturallyAligned (const T &t)
 
template<class U >
 NaturallyAligned (const U &u)
 
NaturallyAlignedoperator= (T other)
 

Detailed Description

template<typename T>
struct pw::NaturallyAligned< T >

Ensures the object is naturally aligned to a power of 2 bytes greater than or equal to its size. NaturallyAligned is a wrapper class.

Example:

#include "pw_alignment/alignment.h"
std::atomic<pw::NaturallyAligned<std::optional<bool>>> nat_aligned_obj;

The documentation for this struct was generated from the following file: