Range-v3
Range algorithms, views, and actions for the Standard Library
range_for.hpp File Reference

Macros

#define RANGES_FOR(VAR_DECL, ...)
 A range-based for macro, basically a hack until the build-in range-for can handle Ranges which have a different type for begin and end. More...
 

Macro Definition Documentation

◆ RANGES_FOR

#define RANGES_FOR (   VAR_DECL,
  ... 
)
Value:
if(bool _range_v3_done = false) {} \
else for(auto && _range_v3_rng = (__VA_ARGS__); !_range_v3_done;) \
for(auto _range_v3_begin = ranges::begin(_range_v3_rng); !_range_v3_done; \
_range_v3_done = true) \
for(auto _range_v3_end = ranges::end(_range_v3_rng); \
!_range_v3_done && _range_v3_begin != _range_v3_end; ++_range_v3_begin) \
if(!(_range_v3_done = true)) {} \
else for(VAR_DECL = *_range_v3_begin; _range_v3_done; _range_v3_done = false) \
constexpr _begin_::fn begin
Definition: begin_end.hpp:111
constexpr _end_::fn end
Definition: begin_end.hpp:192

A range-based for macro, basically a hack until the build-in range-for can handle Ranges which have a different type for begin and end.