|
cppx-core
|
$items_of eases use of standard library functions, e.g. sort( $items_of( numbers ) ).
More...

Go to the source code of this file.
Macros | |
| #define | items_of CPPX_ITEMS_OF |
Real name: $items_of (the $ is just removed by Doxygen). More... | |
| #define | CPPX_ITEMS_OF(c) std::begin( cppx::only_lvalue_ref_to( c ) ), std::end( c ) |
$items_of(c) effectively expands to std::begin(c), std::end(c). More... | |
$items_of eases use of standard library functions, e.g. sort( $items_of( numbers ) ).
Definition in file macro-items_of.hpp.
| #define CPPX_ITEMS_OF | ( | c | ) | std::begin( cppx::only_lvalue_ref_to( c ) ), std::end( c ) |
$items_of(c) effectively expands to std::begin(c), std::end(c).
$items_of eases use of standard library functions in C++ versions before C++20, e.g. std::sort( $items_of( my_numbers ) ).
There is a check that c is not an rvalue expression, where the expansion could inadvertently duplicate a costly or impure function call. But still, be careful. Don't call this macro with an lvalue expression that has side effects.
Definition at line 23 of file macro-items_of.hpp.
| #define items_of CPPX_ITEMS_OF |
Real name: $items_of (the $ is just removed by Doxygen).
Definition at line 11 of file macro-items_of.hpp.
1.8.15