1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11
10 // <experimental/type_traits>
12 #include <experimental/type_traits>
15 #include "test_macros.h"
17 namespace ex
= std::experimental
;
20 using copy_assign_t
= decltype(std::declval
<T
&>() = std::declval
<T
const &>());
22 struct not_assignable
{
23 not_assignable
& operator=(const not_assignable
&) = delete;
26 template <typename T
, bool b
>
28 static_assert( b
== ex::is_detected
<copy_assign_t
, T
>::value
, "" );
29 static_assert( b
== ex::is_detected_v
<copy_assign_t
, T
>, "" );
32 int main(int, char**) {
34 test
<std::string
, true>();
35 test
<not_assignable
, false>();