124dd2d2fSChristopher Di Bella //===----------------------------------------------------------------------===//
224dd2d2fSChristopher Di Bella //
324dd2d2fSChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
424dd2d2fSChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
524dd2d2fSChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
624dd2d2fSChristopher Di Bella //
724dd2d2fSChristopher Di Bella //===----------------------------------------------------------------------===//
824dd2d2fSChristopher Di Bella 
924dd2d2fSChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17
1024dd2d2fSChristopher Di Bella // UNSUPPORTED: libcpp-no-concepts
1124dd2d2fSChristopher Di Bella 
1224dd2d2fSChristopher Di Bella // template<class From, class To>
1324dd2d2fSChristopher Di Bella // concept assignable_from;
1424dd2d2fSChristopher Di Bella 
1524dd2d2fSChristopher Di Bella #include <concepts>
1624dd2d2fSChristopher Di Bella 
1724dd2d2fSChristopher Di Bella #include <deque>
1824dd2d2fSChristopher Di Bella #include <forward_list>
1924dd2d2fSChristopher Di Bella #include <list>
2024dd2d2fSChristopher Di Bella #include <map>
2124dd2d2fSChristopher Di Bella #include <memory>
2224dd2d2fSChristopher Di Bella #include <optional>
2324dd2d2fSChristopher Di Bella #include <string>
2424dd2d2fSChristopher Di Bella #include <string_view>
2524dd2d2fSChristopher Di Bella #include <unordered_map>
2624dd2d2fSChristopher Di Bella #include <vector>
2724dd2d2fSChristopher Di Bella 
28*e1ce3dabSLouis Dionne #ifndef _LIBCPP_HAS_NO_THREADS
29*e1ce3dabSLouis Dionne #   include <mutex>
30*e1ce3dabSLouis Dionne #endif
31*e1ce3dabSLouis Dionne 
3224dd2d2fSChristopher Di Bella #include "../support/allocators.h"
3324dd2d2fSChristopher Di Bella 
3424dd2d2fSChristopher Di Bella // Note: is_lvalue_reference is checked in all ModelsAssignableFrom calls.
3524dd2d2fSChristopher Di Bella template <typename T1, typename T2>
3624dd2d2fSChristopher Di Bella constexpr void NeverAssignableFrom() {
3724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, T2>);
3824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, const T2>);
3924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, T2&>);
4024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, const T2&>);
4124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, volatile T2&>);
4224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, const volatile T2&>);
4324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, T2&&>);
4424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, const T2&&>);
4524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, volatile T2&&>);
4624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1, const volatile T2&&>);
4724dd2d2fSChristopher Di Bella 
4824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2>);
4924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2>);
5024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2&>);
5124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2&>);
5224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, volatile T2&>);
5324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const volatile T2&>);
5424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2&&>);
5524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2&&>);
5624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, volatile T2&&>);
5724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const volatile T2&&>);
5824dd2d2fSChristopher Di Bella 
5924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, T2>);
6024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, const T2>);
6124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, T2&>);
6224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, const T2&>);
6324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, volatile T2&>);
6424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, const volatile T2&>);
6524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, T2&&>);
6624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, const T2&&>);
6724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, volatile T2&&>);
6824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<T1&&, const volatile T2&&>);
6924dd2d2fSChristopher Di Bella 
7024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, T2>);
7124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, const T2>);
7224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, T2&>);
7324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, const T2&>);
7424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, volatile T2&>);
7524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, const volatile T2&>);
7624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, T2&&>);
7724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, const T2&&>);
7824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, volatile T2&&>);
7924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&&, const volatile T2&&>);
8024dd2d2fSChristopher Di Bella 
8124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, T2>);
8224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, const T2>);
8324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, T2&>);
8424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, const T2&>);
8524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, volatile T2&>);
8624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, const volatile T2&>);
8724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, T2&&>);
8824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, const T2&&>);
8924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, volatile T2&&>);
9024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<volatile T1&&, const volatile T2&&>);
9124dd2d2fSChristopher Di Bella 
9224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, T2>);
9324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, const T2>);
9424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, T2&>);
9524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, const T2&>);
9624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, volatile T2&>);
9724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, const volatile T2&>);
9824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, T2&&>);
9924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, const T2&&>);
10024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&&, volatile T2&&>);
10124dd2d2fSChristopher Di Bella   static_assert(
10224dd2d2fSChristopher Di Bella       !std::assignable_from<const volatile T1&&, const volatile T2&&>);
10324dd2d2fSChristopher Di Bella 
10424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, T2>);
10524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, const T2>);
10624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, T2&>);
10724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, const T2&>);
10824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, volatile T2&>);
10924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, const volatile T2&>);
11024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, T2&&>);
11124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, const T2&&>);
11224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, volatile T2&&>);
11324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const T1&, const volatile T2&&>);
11424dd2d2fSChristopher Di Bella 
11524dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2>);
11624dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2>);
11724dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2&>);
11824dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2&>);
11924dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, volatile T2&>);
12024dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const volatile T2&>);
12124dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, T2&&>);
12224dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const T2&&>);
12324dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, volatile T2&&>);
12424dd2d2fSChristopher Di Bella   static_assert(!std::assignable_from<const volatile T1&, const volatile T2&&>);
12524dd2d2fSChristopher Di Bella }
12624dd2d2fSChristopher Di Bella 
12724dd2d2fSChristopher Di Bella template <typename T1, typename T2>
12824dd2d2fSChristopher Di Bella constexpr bool CheckAssignableFromRvalues() {
12924dd2d2fSChristopher Di Bella   NeverAssignableFrom<T1, T2>();
13024dd2d2fSChristopher Di Bella 
13124dd2d2fSChristopher Di Bella   constexpr bool Result = std::assignable_from<T1&, T2>;
13224dd2d2fSChristopher Di Bella   static_assert(std::assignable_from<T1&, T2&&> == Result);
13324dd2d2fSChristopher Di Bella 
13424dd2d2fSChristopher Di Bella   return Result;
13524dd2d2fSChristopher Di Bella }
13624dd2d2fSChristopher Di Bella 
13724dd2d2fSChristopher Di Bella template <typename T1, typename T2>
13824dd2d2fSChristopher Di Bella constexpr bool CheckAssignableFromLvalues() {
13924dd2d2fSChristopher Di Bella   NeverAssignableFrom<T1, T2>();
14024dd2d2fSChristopher Di Bella 
14124dd2d2fSChristopher Di Bella   constexpr bool Result = std::assignable_from<T1&, const T2&>;
14224dd2d2fSChristopher Di Bella   static_assert(std::assignable_from<T1&, T2&> == Result);
14324dd2d2fSChristopher Di Bella   static_assert(std::assignable_from<T1&, const T2&> == Result);
14424dd2d2fSChristopher Di Bella 
14524dd2d2fSChristopher Di Bella   return Result;
14624dd2d2fSChristopher Di Bella }
14724dd2d2fSChristopher Di Bella 
14824dd2d2fSChristopher Di Bella template <typename T1, typename T2>
14924dd2d2fSChristopher Di Bella constexpr bool CheckAssignableFromLvaluesAndRvalues() {
15024dd2d2fSChristopher Di Bella   return CheckAssignableFromLvalues<T1, T2>() &&
15124dd2d2fSChristopher Di Bella          CheckAssignableFromRvalues<T1, T2>();
15224dd2d2fSChristopher Di Bella }
15324dd2d2fSChristopher Di Bella 
15424dd2d2fSChristopher Di Bella namespace BuiltinTypes {
15524dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int, int>());
15624dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int, double>());
15724dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<double, int>());
15824dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int*, int*>());
15924dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<int*, const int*>());
16024dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<int*, volatile int*>());
16124dd2d2fSChristopher Di Bella static_assert(
16224dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<int*, const volatile int*>());
16324dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<const int*, int*>());
16424dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<const int*, const int*>());
16524dd2d2fSChristopher Di Bella static_assert(
16624dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<const int*, volatile int*>());
16724dd2d2fSChristopher Di Bella static_assert(
16824dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<const int*, const volatile int*>());
16924dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<volatile int*, int*>());
17024dd2d2fSChristopher Di Bella static_assert(
17124dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<volatile int*, const int*>());
17224dd2d2fSChristopher Di Bella static_assert(
17324dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<volatile int*, volatile int*>());
17424dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<volatile int*,
17524dd2d2fSChristopher Di Bella                                                     const volatile int*>());
17624dd2d2fSChristopher Di Bella static_assert(
17724dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<const volatile int*, int*>());
17824dd2d2fSChristopher Di Bella static_assert(
17924dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<const volatile int*, const int*>());
18024dd2d2fSChristopher Di Bella static_assert(
18124dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<const volatile int*, volatile int*>());
18224dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<const volatile int*,
18324dd2d2fSChristopher Di Bella                                                    const volatile int*>());
18424dd2d2fSChristopher Di Bella 
18524dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int (*)(), int (*)()>());
18624dd2d2fSChristopher Di Bella static_assert(
18724dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<int (*)(), int (*)() noexcept>());
18824dd2d2fSChristopher Di Bella static_assert(
18924dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<int (*)() noexcept, int (*)()>());
19024dd2d2fSChristopher Di Bella 
19124dd2d2fSChristopher Di Bella struct S {};
19224dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int S::*, int S::*>());
19324dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<const int S::*, int S::*>());
19424dd2d2fSChristopher Di Bella static_assert(
19524dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<int (S::*)(), int (S::*)()>());
19624dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int (S::*)(),
19724dd2d2fSChristopher Di Bella                                                    int (S::*)() noexcept>());
19824dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int (S::*)() const,
19924dd2d2fSChristopher Di Bella                                                    int (S::*)() const>());
20024dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<
20124dd2d2fSChristopher Di Bella               int (S::*)() const, int (S::*)() const noexcept>());
20224dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<int (S::*)() volatile,
20324dd2d2fSChristopher Di Bella                                                    int (S::*)() volatile>());
20424dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<
20524dd2d2fSChristopher Di Bella               int (S::*)() volatile, int (S::*)() volatile noexcept>());
20624dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<
20724dd2d2fSChristopher Di Bella               int (S::*)() const volatile, int (S::*)() const volatile>());
20824dd2d2fSChristopher Di Bella static_assert(
20924dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<
21024dd2d2fSChristopher Di Bella         int (S::*)() const volatile, int (S::*)() const volatile noexcept>());
21124dd2d2fSChristopher Di Bella 
21224dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<void, int>);
21324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<void, void>);
21424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int*&, long*>);
21524dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (&)[5], int[5]>);
21624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)(), int (S::*)() const>);
21724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)() const, int (S::*)()>);
21824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)(), int (S::*)() volatile>);
21924dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)() volatile, int (S::*)()>);
22024dd2d2fSChristopher Di Bella static_assert(
22124dd2d2fSChristopher Di Bella     !std::assignable_from<int (S::*&)(), int (S::*)() const volatile>);
22224dd2d2fSChristopher Di Bella static_assert(
22324dd2d2fSChristopher Di Bella     !std::assignable_from<int (S::*&)() const volatile, int (S::*)()>);
22424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)() noexcept, int (S::*)()>);
22524dd2d2fSChristopher Di Bella static_assert(
22624dd2d2fSChristopher Di Bella     !std::assignable_from<int (S::*&)() const noexcept, int (S::*)() const>);
22724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)() volatile noexcept,
22824dd2d2fSChristopher Di Bella                                     int (S::*)() volatile>);
22924dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<int (S::*&)() const volatile noexcept,
23024dd2d2fSChristopher Di Bella                                     int (S::*)() const volatile>);
23124dd2d2fSChristopher Di Bella } // namespace BuiltinTypes
23224dd2d2fSChristopher Di Bella 
23324dd2d2fSChristopher Di Bella namespace TypesFitForPurpose {
23424dd2d2fSChristopher Di Bella struct T1 {};
23524dd2d2fSChristopher Di Bella 
23624dd2d2fSChristopher Di Bella struct NoCommonReference {};
23724dd2d2fSChristopher Di Bella static_assert(!std::common_reference_with<const T1&, const NoCommonReference&>);
23824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<NoCommonReference&, T1>);
23924dd2d2fSChristopher Di Bella 
24024dd2d2fSChristopher Di Bella struct AssignmentReturnsNonReference {
24124dd2d2fSChristopher Di Bella   AssignmentReturnsNonReference operator=(T1);
24224dd2d2fSChristopher Di Bella   operator T1() const;
24324dd2d2fSChristopher Di Bella };
24424dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<const T1&,
24524dd2d2fSChristopher Di Bella                                          const AssignmentReturnsNonReference&>);
24624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<AssignmentReturnsNonReference&, T1>);
24724dd2d2fSChristopher Di Bella 
24824dd2d2fSChristopher Di Bella struct NonCVAssignmentOnly {
24924dd2d2fSChristopher Di Bella   NonCVAssignmentOnly& operator=(T1);
25024dd2d2fSChristopher Di Bella   operator T1() const;
25124dd2d2fSChristopher Di Bella };
25224dd2d2fSChristopher Di Bella static_assert(
25324dd2d2fSChristopher Di Bella     std::common_reference_with<const T1&, const NonCVAssignmentOnly&>);
25424dd2d2fSChristopher Di Bella static_assert(std::assignable_from<NonCVAssignmentOnly&, T1>);
25524dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const NonCVAssignmentOnly&, T1>);
25624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<volatile NonCVAssignmentOnly&, T1>);
25724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const volatile NonCVAssignmentOnly&, T1>);
25824dd2d2fSChristopher Di Bella 
25924dd2d2fSChristopher Di Bella struct NonCVAssignmentOnlyConstQualified {
26024dd2d2fSChristopher Di Bella   NonCVAssignmentOnlyConstQualified& operator=(T1) const;
26124dd2d2fSChristopher Di Bella   operator T1() const;
26224dd2d2fSChristopher Di Bella };
26324dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<
26424dd2d2fSChristopher Di Bella               const T1&, const NonCVAssignmentOnlyConstQualified&>);
26524dd2d2fSChristopher Di Bella static_assert(std::assignable_from<NonCVAssignmentOnlyConstQualified&, T1>);
26624dd2d2fSChristopher Di Bella static_assert(
26724dd2d2fSChristopher Di Bella     !std::assignable_from<const NonCVAssignmentOnlyConstQualified&, T1>);
26824dd2d2fSChristopher Di Bella static_assert(
26924dd2d2fSChristopher Di Bella     !std::assignable_from<volatile NonCVAssignmentOnlyConstQualified&, T1>);
27024dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
27124dd2d2fSChristopher Di Bella               const volatile NonCVAssignmentOnlyConstQualified&, T1>);
27224dd2d2fSChristopher Di Bella 
27324dd2d2fSChristopher Di Bella struct NonCVAssignmentVolatileQualified {
27424dd2d2fSChristopher Di Bella   NonCVAssignmentVolatileQualified& operator=(T1) volatile;
27524dd2d2fSChristopher Di Bella   operator T1() const volatile;
27624dd2d2fSChristopher Di Bella };
27724dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<
27824dd2d2fSChristopher Di Bella               const T1&, const NonCVAssignmentVolatileQualified&>);
27924dd2d2fSChristopher Di Bella static_assert(std::assignable_from<NonCVAssignmentVolatileQualified&, T1>);
28024dd2d2fSChristopher Di Bella static_assert(
28124dd2d2fSChristopher Di Bella     !std::assignable_from<const NonCVAssignmentVolatileQualified&, T1>);
28224dd2d2fSChristopher Di Bella static_assert(
28324dd2d2fSChristopher Di Bella     !std::assignable_from<volatile NonCVAssignmentVolatileQualified&, T1>);
28424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
28524dd2d2fSChristopher Di Bella               const volatile NonCVAssignmentVolatileQualified&, T1>);
28624dd2d2fSChristopher Di Bella 
28724dd2d2fSChristopher Di Bella struct NonCVAssignmentOnlyCVQualified {
28824dd2d2fSChristopher Di Bella   NonCVAssignmentOnlyCVQualified& operator=(T1) const volatile;
28924dd2d2fSChristopher Di Bella   operator T1() const volatile;
29024dd2d2fSChristopher Di Bella };
29124dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<
29224dd2d2fSChristopher Di Bella               const T1&, const NonCVAssignmentOnlyCVQualified&>);
29324dd2d2fSChristopher Di Bella static_assert(std::assignable_from<NonCVAssignmentOnlyCVQualified&, T1>);
29424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const NonCVAssignmentOnlyCVQualified&, T1>);
29524dd2d2fSChristopher Di Bella static_assert(
29624dd2d2fSChristopher Di Bella     !std::assignable_from<volatile NonCVAssignmentOnlyCVQualified&, T1>);
29724dd2d2fSChristopher Di Bella static_assert(
29824dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile NonCVAssignmentOnlyCVQualified&, T1>);
29924dd2d2fSChristopher Di Bella 
30024dd2d2fSChristopher Di Bella struct ConstAssignmentOnly {
30124dd2d2fSChristopher Di Bella   const ConstAssignmentOnly& operator=(T1) const;
30224dd2d2fSChristopher Di Bella   operator T1() const;
30324dd2d2fSChristopher Di Bella };
30424dd2d2fSChristopher Di Bella static_assert(
30524dd2d2fSChristopher Di Bella     std::common_reference_with<const T1&, const ConstAssignmentOnly&>);
30624dd2d2fSChristopher Di Bella static_assert(std::assignable_from<const ConstAssignmentOnly&, T1>);
30724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<ConstAssignmentOnly&, T1>);
30824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<volatile ConstAssignmentOnly&, T1>);
30924dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const volatile ConstAssignmentOnly&, T1>);
31024dd2d2fSChristopher Di Bella 
31124dd2d2fSChristopher Di Bella struct VolatileAssignmentOnly {
31224dd2d2fSChristopher Di Bella   volatile VolatileAssignmentOnly& operator=(T1) volatile;
31324dd2d2fSChristopher Di Bella   operator T1() const volatile;
31424dd2d2fSChristopher Di Bella };
31524dd2d2fSChristopher Di Bella static_assert(
31624dd2d2fSChristopher Di Bella     std::common_reference_with<const T1&, const VolatileAssignmentOnly&>);
31724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<VolatileAssignmentOnly&, T1>);
31824dd2d2fSChristopher Di Bella static_assert(std::assignable_from<volatile VolatileAssignmentOnly&, T1>);
31924dd2d2fSChristopher Di Bella 
32024dd2d2fSChristopher Di Bella struct CVAssignmentOnly {
32124dd2d2fSChristopher Di Bella   const volatile CVAssignmentOnly& operator=(T1) const volatile;
32224dd2d2fSChristopher Di Bella   operator T1() const volatile;
32324dd2d2fSChristopher Di Bella };
32424dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<const T1&, const CVAssignmentOnly&>);
32524dd2d2fSChristopher Di Bella static_assert(std::assignable_from<const volatile CVAssignmentOnly&, T1>);
32624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<CVAssignmentOnly&, T1>);
32724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const CVAssignmentOnly&, T1>);
32824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<volatile CVAssignmentOnly&, T1>);
32924dd2d2fSChristopher Di Bella 
33024dd2d2fSChristopher Di Bella struct LvalueRefQualifiedWithRvalueT1Only {
33124dd2d2fSChristopher Di Bella   LvalueRefQualifiedWithRvalueT1Only& operator=(T1&&) &;
33224dd2d2fSChristopher Di Bella   const LvalueRefQualifiedWithRvalueT1Only& operator=(T1&&) const&;
33324dd2d2fSChristopher Di Bella   volatile LvalueRefQualifiedWithRvalueT1Only& operator=(T1&&) volatile&;
33424dd2d2fSChristopher Di Bella   const volatile LvalueRefQualifiedWithRvalueT1Only& operator=(T1&&) const
33524dd2d2fSChristopher Di Bella       volatile&;
33624dd2d2fSChristopher Di Bella   operator T1() const volatile;
33724dd2d2fSChristopher Di Bella };
33824dd2d2fSChristopher Di Bella static_assert(std::common_reference_with<
33924dd2d2fSChristopher Di Bella               const T1&, const LvalueRefQualifiedWithRvalueT1Only&>);
34024dd2d2fSChristopher Di Bella static_assert(std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, T1&&>);
34124dd2d2fSChristopher Di Bella static_assert(
34224dd2d2fSChristopher Di Bella     std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&, T1&&>);
34324dd2d2fSChristopher Di Bella static_assert(
34424dd2d2fSChristopher Di Bella     std::assignable_from<volatile LvalueRefQualifiedWithRvalueT1Only&, T1&&>);
34524dd2d2fSChristopher Di Bella static_assert(std::assignable_from<
34624dd2d2fSChristopher Di Bella               const volatile LvalueRefQualifiedWithRvalueT1Only&, T1&&>);
34724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, T1&>);
34824dd2d2fSChristopher Di Bella static_assert(
34924dd2d2fSChristopher Di Bella     !std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&, T1&>);
35024dd2d2fSChristopher Di Bella static_assert(
35124dd2d2fSChristopher Di Bella     !std::assignable_from<volatile LvalueRefQualifiedWithRvalueT1Only&, T1&>);
35224dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
35324dd2d2fSChristopher Di Bella               const volatile LvalueRefQualifiedWithRvalueT1Only&, T1&>);
35424dd2d2fSChristopher Di Bella static_assert(
35524dd2d2fSChristopher Di Bella     !std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, const T1&>);
35624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
35724dd2d2fSChristopher Di Bella                                     const T1&>);
35824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
35924dd2d2fSChristopher Di Bella               volatile LvalueRefQualifiedWithRvalueT1Only&, const T1&>);
36024dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
36124dd2d2fSChristopher Di Bella               const volatile LvalueRefQualifiedWithRvalueT1Only&, const T1&>);
36224dd2d2fSChristopher Di Bella static_assert(
36324dd2d2fSChristopher Di Bella     !std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, volatile T1&>);
36424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
36524dd2d2fSChristopher Di Bella                                     volatile T1&>);
36624dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
36724dd2d2fSChristopher Di Bella               volatile LvalueRefQualifiedWithRvalueT1Only&, volatile T1&>);
36824dd2d2fSChristopher Di Bella static_assert(
36924dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile LvalueRefQualifiedWithRvalueT1Only&,
37024dd2d2fSChristopher Di Bella                           volatile T1&>);
37124dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&,
37224dd2d2fSChristopher Di Bella                                     const volatile T1&>);
37324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
37424dd2d2fSChristopher Di Bella                                     const volatile T1&>);
37524dd2d2fSChristopher Di Bella static_assert(
37624dd2d2fSChristopher Di Bella     !std::assignable_from<volatile LvalueRefQualifiedWithRvalueT1Only&,
37724dd2d2fSChristopher Di Bella                           const volatile T1&>);
37824dd2d2fSChristopher Di Bella static_assert(
37924dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile LvalueRefQualifiedWithRvalueT1Only&,
38024dd2d2fSChristopher Di Bella                           const volatile T1&>);
38124dd2d2fSChristopher Di Bella static_assert(
38224dd2d2fSChristopher Di Bella     !std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, const T1&&>);
38324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
38424dd2d2fSChristopher Di Bella                                     const T1&&>);
38524dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
38624dd2d2fSChristopher Di Bella               volatile LvalueRefQualifiedWithRvalueT1Only&, const T1&&>);
38724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
38824dd2d2fSChristopher Di Bella               const volatile LvalueRefQualifiedWithRvalueT1Only&, const T1&&>);
38924dd2d2fSChristopher Di Bella static_assert(
39024dd2d2fSChristopher Di Bella     !std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&, volatile T1&&>);
39124dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
39224dd2d2fSChristopher Di Bella                                     volatile T1&&>);
39324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<
39424dd2d2fSChristopher Di Bella               volatile LvalueRefQualifiedWithRvalueT1Only&, volatile T1&&>);
39524dd2d2fSChristopher Di Bella static_assert(
39624dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile LvalueRefQualifiedWithRvalueT1Only&,
39724dd2d2fSChristopher Di Bella                           volatile T1&&>);
39824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<LvalueRefQualifiedWithRvalueT1Only&,
39924dd2d2fSChristopher Di Bella                                     const volatile T1&&>);
40024dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const LvalueRefQualifiedWithRvalueT1Only&,
40124dd2d2fSChristopher Di Bella                                     const volatile T1&&>);
40224dd2d2fSChristopher Di Bella static_assert(
40324dd2d2fSChristopher Di Bella     !std::assignable_from<volatile LvalueRefQualifiedWithRvalueT1Only&,
40424dd2d2fSChristopher Di Bella                           const volatile T1&&>);
40524dd2d2fSChristopher Di Bella static_assert(
40624dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile LvalueRefQualifiedWithRvalueT1Only&,
40724dd2d2fSChristopher Di Bella                           const volatile T1&&>);
40824dd2d2fSChristopher Di Bella 
40924dd2d2fSChristopher Di Bella struct NoLvalueRefAssignment {
41024dd2d2fSChristopher Di Bella   NoLvalueRefAssignment& operator=(T1) &&;
41124dd2d2fSChristopher Di Bella   const NoLvalueRefAssignment& operator=(T1) const&&;
41224dd2d2fSChristopher Di Bella   volatile NoLvalueRefAssignment& operator=(T1) volatile&&;
41324dd2d2fSChristopher Di Bella   const volatile NoLvalueRefAssignment& operator=(T1) const volatile&&;
41424dd2d2fSChristopher Di Bella   operator T1() const volatile;
41524dd2d2fSChristopher Di Bella };
41624dd2d2fSChristopher Di Bella static_assert(
41724dd2d2fSChristopher Di Bella     std::common_reference_with<const T1&, const NoLvalueRefAssignment&>);
41824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<NoLvalueRefAssignment&, T1>);
41924dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<NoLvalueRefAssignment&, const T1>);
42024dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<NoLvalueRefAssignment&, volatile T1>);
42124dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<NoLvalueRefAssignment&, const volatile T1>);
42224dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const NoLvalueRefAssignment&, T1>);
42324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const NoLvalueRefAssignment&, const T1>);
42424dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const NoLvalueRefAssignment&, volatile T1>);
42524dd2d2fSChristopher Di Bella static_assert(
42624dd2d2fSChristopher Di Bella     !std::assignable_from<const NoLvalueRefAssignment&, const volatile T1>);
42724dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<volatile NoLvalueRefAssignment&, T1>);
42824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<volatile NoLvalueRefAssignment&, const T1>);
42924dd2d2fSChristopher Di Bella static_assert(
43024dd2d2fSChristopher Di Bella     !std::assignable_from<volatile NoLvalueRefAssignment&, volatile T1>);
43124dd2d2fSChristopher Di Bella static_assert(
43224dd2d2fSChristopher Di Bella     !std::assignable_from<volatile NoLvalueRefAssignment&, const volatile T1>);
43324dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const volatile NoLvalueRefAssignment&, T1>);
43424dd2d2fSChristopher Di Bella static_assert(
43524dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile NoLvalueRefAssignment&, const T1>);
43624dd2d2fSChristopher Di Bella static_assert(
43724dd2d2fSChristopher Di Bella     !std::assignable_from<const volatile NoLvalueRefAssignment&, volatile T1>);
43824dd2d2fSChristopher Di Bella static_assert(!std::assignable_from<const volatile NoLvalueRefAssignment&,
43924dd2d2fSChristopher Di Bella                                     const volatile T1>);
44024dd2d2fSChristopher Di Bella } // namespace TypesFitForPurpose
44124dd2d2fSChristopher Di Bella 
44224dd2d2fSChristopher Di Bella namespace StandardTypes {
44324dd2d2fSChristopher Di Bella static_assert(
44424dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::deque<int>, std::deque<int> >());
44524dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::deque<int>,
44624dd2d2fSChristopher Di Bella                                                     std::deque<const int> >());
44724dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
44824dd2d2fSChristopher Di Bella               std::deque<int>, std::deque<int, A1<int> > >());
44924dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::deque<int>,
45024dd2d2fSChristopher Di Bella                                                     std::vector<int> >());
45124dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::deque<int>, int>());
45224dd2d2fSChristopher Di Bella 
45324dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::forward_list<int>,
45424dd2d2fSChristopher Di Bella                                                    std::forward_list<int> >());
45524dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
45624dd2d2fSChristopher Di Bella               std::forward_list<int>, std::forward_list<const int> >());
45724dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
45824dd2d2fSChristopher Di Bella               std::forward_list<int>, std::forward_list<int, A1<int> > >());
45924dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::forward_list<int>,
46024dd2d2fSChristopher Di Bella                                                     std::vector<int> >());
46124dd2d2fSChristopher Di Bella static_assert(
46224dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<std::forward_list<int>, int>());
46324dd2d2fSChristopher Di Bella 
46424dd2d2fSChristopher Di Bella static_assert(
46524dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::list<int>, std::list<int> >());
46624dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::list<int>,
46724dd2d2fSChristopher Di Bella                                                     std::list<const int> >());
46824dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
46924dd2d2fSChristopher Di Bella               std::list<int>, std::list<int, A1<int> > >());
47024dd2d2fSChristopher Di Bella static_assert(
47124dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<std::list<int>, std::vector<int> >());
47224dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::list<int>, int>());
47324dd2d2fSChristopher Di Bella 
47424dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::map<int, void*>,
47524dd2d2fSChristopher Di Bella                                                    std::map<int, void*> >());
47624dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
47724dd2d2fSChristopher Di Bella               std::map<int, void*>, std::map<const int, void*> >());
47824dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
47924dd2d2fSChristopher Di Bella               std::map<int, void*>,
48024dd2d2fSChristopher Di Bella               std::map<int, void*, A1<std::pair<int, void*> > > >());
48124dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
48224dd2d2fSChristopher Di Bella               std::map<int, void*>, std::unordered_map<int, void*> >());
48324dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::map<int, void*>,
48424dd2d2fSChristopher Di Bella                                                     std::pair<int, void*> >());
48524dd2d2fSChristopher Di Bella 
48624dd2d2fSChristopher Di Bella #ifndef _LIBCPP_HAS_NO_THREADS
48724dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromRvalues<std::mutex, std::mutex>());
48824dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvalues<std::mutex, std::mutex>());
48924dd2d2fSChristopher Di Bella #endif
49024dd2d2fSChristopher Di Bella 
49124dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::optional<int>, int>());
49224dd2d2fSChristopher Di Bella static_assert(
49324dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::optional<int>, double>());
49424dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::optional<int>,
49524dd2d2fSChristopher Di Bella                                                    std::optional<int> >());
49624dd2d2fSChristopher Di Bella static_assert(
49724dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<int, std::optional<int> >());
49824dd2d2fSChristopher Di Bella static_assert(
49924dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<double, std::optional<int> >());
50024dd2d2fSChristopher Di Bella 
50124dd2d2fSChristopher Di Bella static_assert(
50224dd2d2fSChristopher Di Bella     !std::common_reference_with<std::optional<int>, std::optional<double> >);
50324dd2d2fSChristopher Di Bella static_assert(
50424dd2d2fSChristopher Di Bella     !CheckAssignableFromRvalues<std::optional<int>, std::optional<double> >());
50524dd2d2fSChristopher Di Bella static_assert(
50624dd2d2fSChristopher Di Bella     !CheckAssignableFromLvalues<std::optional<int>, std::optional<double> >());
50724dd2d2fSChristopher Di Bella 
50824dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::string, std::string>());
50924dd2d2fSChristopher Di Bella static_assert(
51024dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::string, std::string_view>());
51124dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::string, char*>());
51224dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::string, const char*>());
51324dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
51424dd2d2fSChristopher Di Bella               std::string, std::basic_string<wchar_t> >());
51524dd2d2fSChristopher Di Bella static_assert(
51624dd2d2fSChristopher Di Bella     !CheckAssignableFromLvaluesAndRvalues<std::string, std::vector<char> >());
51724dd2d2fSChristopher Di Bella 
51824dd2d2fSChristopher Di Bella static_assert(
51924dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::string_view, std::string_view>());
52024dd2d2fSChristopher Di Bella static_assert(
52124dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::string_view, std::string>());
52224dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::string_view, char*>());
52324dd2d2fSChristopher Di Bella static_assert(
52424dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::string_view, const char*>());
52524dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
52624dd2d2fSChristopher Di Bella               std::string_view, std::basic_string_view<wchar_t> >());
52724dd2d2fSChristopher Di Bella 
52824dd2d2fSChristopher Di Bella static_assert(
52924dd2d2fSChristopher Di Bella     CheckAssignableFromRvalues<std::unique_ptr<int>, std::unique_ptr<int> >());
53024dd2d2fSChristopher Di Bella static_assert(
53124dd2d2fSChristopher Di Bella     !CheckAssignableFromLvalues<std::unique_ptr<int>, std::unique_ptr<int> >());
53224dd2d2fSChristopher Di Bella 
53324dd2d2fSChristopher Di Bella static_assert(
53424dd2d2fSChristopher Di Bella     CheckAssignableFromLvaluesAndRvalues<std::unordered_map<int, void*>,
53524dd2d2fSChristopher Di Bella                                          std::unordered_map<int, void*> >());
53624dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
53724dd2d2fSChristopher Di Bella               std::unordered_map<int, void*>,
53824dd2d2fSChristopher Di Bella               std::unordered_map<const int, void*> >());
53924dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
54024dd2d2fSChristopher Di Bella               std::unordered_map<int, void*>,
54124dd2d2fSChristopher Di Bella               std::unordered_map<int, void*, A1<std::pair<int, void*> > > >());
54224dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
54324dd2d2fSChristopher Di Bella               std::unordered_map<int, void*>, std::map<int, void*> >());
54424dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
54524dd2d2fSChristopher Di Bella               std::unordered_map<int, void*>, std::pair<int, void*> >());
54624dd2d2fSChristopher Di Bella 
54724dd2d2fSChristopher Di Bella static_assert(CheckAssignableFromLvaluesAndRvalues<std::vector<int>,
54824dd2d2fSChristopher Di Bella                                                    std::vector<int> >());
54924dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::deque<int>,
55024dd2d2fSChristopher Di Bella                                                     std::deque<const int> >());
55124dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<
55224dd2d2fSChristopher Di Bella               std::vector<int>, std::vector<int, A1<int> > >());
55324dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::vector<int>,
55424dd2d2fSChristopher Di Bella                                                     std::deque<int> >());
55524dd2d2fSChristopher Di Bella static_assert(!CheckAssignableFromLvaluesAndRvalues<std::vector<int>, int>());
55624dd2d2fSChristopher Di Bella } // namespace StandardTypes
55724dd2d2fSChristopher Di Bella 
55824dd2d2fSChristopher Di Bella int main(int, char**) { return 0; }
559