type.pass.cpp revision c52f43e72dfcea03037729649da84c23b3beb04a
1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. 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 19class C {}; 20 21int 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