|
MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
|
The attributes of a later standard, as macros, where the compiler has them. More...
Go to the source code of this file.
Macros | |
| #define | MAXMATRIX_NODISCARD __attribute__((warn_unused_result)) |
| Marks a function whose result must not be dropped: the compiler warns where it is. | |
Functions | |
| template<typename Value> | |
| void | max_matrix::Discard (Value const &) |
| Drops a result marked with MAXMATRIX_NODISCARD on purpose, with the reason in a comment beside the call. | |
The attributes of a later standard, as macros, where the compiler has them.
| #define MAXMATRIX_NODISCARD __attribute__((warn_unused_result)) |
Marks a function whose result must not be dropped: the compiler warns where it is.
[[nodiscard]] where the compiler has it, GCC's warn_unused_result otherwise. The library marks a getter's result, whose value would be lost, and the results the parts below Matrix pass on; not a setter's Status, which a sketch may drop when it has no one to tell.
| void max_matrix::Discard | ( | Value const & | ) |
Drops a result marked with MAXMATRIX_NODISCARD on purpose, with the reason in a comment beside the call.
Rather than a cast to void: where the macro is warn_unused_result, GCC warns through a cast, clang does not, so a cast that passes on the host could fail the build for the board.
| Value | The type of the result. |