.. _range: *********** meta::range *********** Defined in header ````. .. code-block:: cpp template concept range = requires(T&& t) { /* using std::begin; */ begin(t); /* using std::end; */ end(t); }; Pre-C++20 implementation of the :rangeconcept:`range` concept. ---- Differences with the C++20 version ================================== * The implementation does not rely on :cpp:`std::ranges::begin `, but on the usual customization point idiom, i.e. ``using std::begin; begin(/* ... */);``. Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_range { /* ... */ }; template constexpr auto is_range_v = is_range::value; template >> using range = T; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include using namespace mgs::meta; struct output_range { std::back_insert_iterator begin(); std::back_insert_iterator end(); }; static_assert(is_range_v, ""); static_assert(is_range_v, ""); static_assert(is_range_v, "");