.. _dereferenceable: ********************* meta::dereferenceable ********************* Defined in header ````. .. code-block:: cpp template concept dereferenceable = requires(T& t) { { *t } -> /* see below */; }; Pre-C++20 implementation of the *exposition-only* `dereferenceable `__ concept. ---- The **dereferenceable** concept specifies that the type obtained when dereferencing a value of type **T** is itself referenceable. Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_dereferenceable { /* ... */ }; template constexpr auto is_dereferenceable_v = is_dereferenceable::value; template >> using dereferenceable = T; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include using namespace mgs::meta; struct invalid { void operator*(); }; static_assert(is_dereferenceable_v, ""); static_assert(!is_dereferenceable_v, ""); // void cannot be referenced (i.e. void& is ill-formed) static_assert(!is_dereferenceable_v, "");