.. _constructible_from: ************************ meta::constructible_from ************************ Defined in header ````. .. code-block:: cpp template concept constructible_from = meta::destructible && std::is_constructible_v; Pre-C++20 implementation of the :concept:`constructible_from` concept. ---- Differences with the C++20 version ================================== * Checks template arguments before calling :cpp:`std::is_constructible_v `, which is not SFINAE-friendly. Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_constructible_from { /* ... */ }; template constexpr auto is_constructible_from_v = is_constructible_from::value; } // namespace meta } // namespace mgs .. note:: Unlike other concept emulations, there is no ``constructible_from`` alias because of the template parameter pack. Example ======= .. code-block:: cpp #include using namespace mgs::meta; static_assert(is_constructible_from_v, ""); static_assert(is_constructible_from_v, ""); static_assert(is_constructible_from_v, ""); static_assert(!is_constructible_from_v, ""); See also ======== * :ref:`destructible`