[libcxx] adds concept `std::assignable_from`
Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can
Depends on D96660
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D96742
GitOrigin-RevId: 647af31e74830e067834f50985f18ac7cc16c2a3
diff --git a/include/concepts b/include/concepts
index f13b18f..505ade9 100644
--- a/include/concepts
+++ b/include/concepts
@@ -210,6 +210,15 @@
template<class _Tp>
concept floating_point = is_floating_point_v<_Tp>;
+// [concept.assignable]
+template<class _Lhs, class _Rhs>
+concept assignable_from =
+ is_lvalue_reference_v<_Lhs> &&
+ common_reference_with<const remove_reference_t<_Lhs>&, const remove_reference_t<_Rhs>&> &&
+ requires (_Lhs __lhs, _Rhs&& __rhs) {
+ { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
+ };
+
// [concept.destructible]
template<class _Tp>