1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <functional>
11 
12 // reference_wrapper
13 
14 // check for member typedef type
15 
16 #include <functional>
17 #include <type_traits>
18 
19 class C {};
20 
main()21 int main()
22 {
23     static_assert((std::is_same<std::reference_wrapper<C>::type,
24                                                        C>::value), "");
25     static_assert((std::is_same<std::reference_wrapper<void ()>::type,
26                                                        void ()>::value), "");
27     static_assert((std::is_same<std::reference_wrapper<int* (double*)>::type,
28                                                        int* (double*)>::value), "");
29     static_assert((std::is_same<std::reference_wrapper<void(*)()>::type,
30                                                        void(*)()>::value), "");
31     static_assert((std::is_same<std::reference_wrapper<int*(*)(double*)>::type,
32                                                        int*(*)(double*)>::value), "");
33     static_assert((std::is_same<std::reference_wrapper<int*(C::*)(double*)>::type,
34                                                        int*(C::*)(double*)>::value), "");
35     static_assert((std::is_same<std::reference_wrapper<int (C::*)(double*) const volatile>::type,
36                                                        int (C::*)(double*) const volatile>::value), "");
37 }
38