add_pointer.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// type_traits 11 12// add_pointer 13 14#include <type_traits> 15 16template <class T, class U> 17void test_add_pointer() 18{ 19 static_assert((std::is_same<typename std::add_pointer<T>::type, U>::value), ""); 20} 21 22int main() 23{ 24 test_add_pointer<void, void*>(); 25 test_add_pointer<int, int*>(); 26 test_add_pointer<int[3], int(*)[3]>(); 27 test_add_pointer<int&, int*>(); 28 test_add_pointer<const int&, const int*>(); 29 test_add_pointer<int*, int**>(); 30 test_add_pointer<const int*, const int**>(); 31} 32