Loading...
Searching...
No Matches
Go to the documentation of this file.
14#ifndef RANGES_V3_RANGE_FOR_HPP
15#define RANGES_V3_RANGE_FOR_HPP
21#if RANGES_CXX_RANGE_BASED_FOR < RANGES_CXX_RANGE_BASED_FOR_17
24#define RANGES_FOR(VAR_DECL, ...) \
25 if(bool CPP_PP_CAT(_range_v3_done, __LINE__) = false) {} \
27 for(auto && CPP_PP_CAT(_range_v3_rng, __LINE__) = (__VA_ARGS__); \
28 !CPP_PP_CAT(_range_v3_done, __LINE__);) \
29 for(auto CPP_PP_CAT(_range_v3_begin, __LINE__) = \
30 ranges::begin(CPP_PP_CAT(_range_v3_rng, __LINE__)); \
31 !CPP_PP_CAT(_range_v3_done, __LINE__); \
32 CPP_PP_CAT(_range_v3_done, __LINE__) = true) \
33 for(auto CPP_PP_CAT(_range_v3_end, __LINE__) = \
34 ranges::end(CPP_PP_CAT(_range_v3_rng, __LINE__)); \
35 !CPP_PP_CAT(_range_v3_done, __LINE__) && \
36 CPP_PP_CAT(_range_v3_begin, __LINE__) != \
37 CPP_PP_CAT(_range_v3_end, __LINE__); \
38 ++CPP_PP_CAT(_range_v3_begin, __LINE__)) \
39 if(!(CPP_PP_CAT(_range_v3_done, __LINE__) = true)) {} \
41 for(VAR_DECL = *CPP_PP_CAT(_range_v3_begin, __LINE__); \
42 CPP_PP_CAT(_range_v3_done, __LINE__); \
43 CPP_PP_CAT(_range_v3_done, __LINE__) = false) \
47#define RANGES_FOR(VAR_DECL, ...) for(VAR_DECL : (__VA_ARGS__))