1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 // <functional>
10
11 // reference_wrapper
12
13 // check for member typedef type
14
15 #include <functional>
16 #include <type_traits>
17
18 #include "test_macros.h"
19
20 class C {};
21
main(int,char **)22 int main(int, char**)
23 {
24 static_assert((std::is_same<std::reference_wrapper<C>::type,
25 C>::value), "");
26 static_assert((std::is_same<std::reference_wrapper<void ()>::type,
27 void ()>::value), "");
28 static_assert((std::is_same<std::reference_wrapper<int* (double*)>::type,
29 int* (double*)>::value), "");
30 static_assert((std::is_same<std::reference_wrapper<void(*)()>::type,
31 void(*)()>::value), "");
32 static_assert((std::is_same<std::reference_wrapper<int*(*)(double*)>::type,
33 int*(*)(double*)>::value), "");
34 static_assert((std::is_same<std::reference_wrapper<int*(C::*)(double*)>::type,
35 int*(C::*)(double*)>::value), "");
36 static_assert((std::is_same<std::reference_wrapper<int (C::*)(double*) const volatile>::type,
37 int (C::*)(double*) const volatile>::value), "");
38
39 return 0;
40 }
41