.. _assignable_from: ********************* meta::assignable_from ********************* Defined in header ````. .. code-block:: cpp template concept assignable_from = std::is_lvalue_reference_v && meta::common_reference_with< std::remove_reference_t const&, std::remove_reference_t const&> && requires(LHS lhs, RHS&& rhs) { lhs = std::forward(rhs); requires meta::same_as(rhs)), LHS>; }; Pre-C++20 implementation of the :concept:`assignable_from` concept. ---- Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_assignable_from { /* ... */ }; template constexpr auto is_assignable_from_v = is_assignable_from::value; template >> using assignable_from = LHS; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include using namespace mgs::meta; static_assert(is_assignable_from_v, ""); static_assert(!is_assignable_from_v, ""); See also ======== * :ref:`common_reference_with` * :ref:`same_as`