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 // struct is_placeholder 13 14 #include <functional> 15 16 template <int Expected, class T> 17 void test(const T &)18test(const T&) 19 { 20 static_assert(std::is_placeholder<T>::value == Expected, ""); 21 } 22 23 struct C {}; 24 main()25int main() 26 { 27 test<1>(std::placeholders::_1); 28 test<2>(std::placeholders::_2); 29 test<3>(std::placeholders::_3); 30 test<4>(std::placeholders::_4); 31 test<5>(std::placeholders::_5); 32 test<6>(std::placeholders::_6); 33 test<7>(std::placeholders::_7); 34 test<8>(std::placeholders::_8); 35 test<9>(std::placeholders::_9); 36 test<10>(std::placeholders::_10); 37 test<0>(4); 38 test<0>(5.5); 39 test<0>('a'); 40 test<0>(C()); 41 } 42