remove_pointer.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
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// type_traits 11 12// remove_pointer 13 14#include <type_traits> 15 16template <class T, class U> 17void test_remove_pointer() 18{ 19 static_assert((std::is_same<typename std::remove_pointer<T>::type, U>::value), ""); 20} 21 22int main() 23{ 24 test_remove_pointer<void, void>(); 25 test_remove_pointer<int, int>(); 26 test_remove_pointer<int[3], int[3]>(); 27 test_remove_pointer<int*, int>(); 28 test_remove_pointer<const int*, const int>(); 29 test_remove_pointer<int**, int*>(); 30 test_remove_pointer<int** const, int*>(); 31 test_remove_pointer<int*const * , int* const>(); 32 test_remove_pointer<const int** , const int*>(); 33 34 test_remove_pointer<int&, int&>(); 35 test_remove_pointer<const int&, const int&>(); 36 test_remove_pointer<int(&)[3], int(&)[3]>(); 37 test_remove_pointer<int(*)[3], int[3]>(); 38 test_remove_pointer<int*&, int*&>(); 39 test_remove_pointer<const int*&, const int*&>(); 40} 41