|
MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
|
A reference to a T that is never null and owns nothing. More...
#include <reference_wrapper.h>
Public Types | |
| using | type = T |
Public Member Functions | |
| constexpr | reference_wrapper (T &object) |
| Makes a reference to object. | |
| reference_wrapper (T &&)=delete | |
| Deleted: a temporary would be gone before the first use. | |
| MAXMATRIX_NODISCARD constexpr T & | get () const |
| Returns the object referred to. | |
| constexpr | operator T& () const |
| Returns the object referred to, so that it passes as a T&. | |
A reference to a T that is never null and owns nothing.
It is meant for a member that refers to an object another owns, as CodingStyle.md FN-15 asks: a T& member takes the assignment from the class, and a T* leaves open whether it may be null. Inside it is a pointer, 2 bytes on the Uno.
It binds an lvalue only, never a temporary, which would be gone before the first use. Assigning one rebinds it, as in the standard; to write through it, use get().
| T | The type referred to, const for a reference that cannot write. |
| using max_matrix::internal::reference_wrapper< T >::type = T |
The type referred to.
|
inlineconstexpr |
Makes a reference to object.
Implicit, as in the standard, so that a member is initialized from the object itself.
| [in] | object | The object, an lvalue. |
|
delete |
Deleted: a temporary would be gone before the first use.
|
inlineconstexpr |
Returns the object referred to, so that it passes as a T&.
Implicit, as in the standard, for a function that takes a T&.