• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "test_macros.h"
16 
17 template <int Expected, class T>
18 void
test(const T &)19 test(const T&)
20 {
21     static_assert(std::is_placeholder<T>::value == Expected, "");
22 #if TEST_STD_VER > 14
23     static_assert(std::is_placeholder_v<T> == Expected, "");
24 #endif
25 }
26 
27 struct C {};
28 
main()29 int main()
30 {
31     test<1>(std::placeholders::_1);
32     test<2>(std::placeholders::_2);
33     test<3>(std::placeholders::_3);
34     test<4>(std::placeholders::_4);
35     test<5>(std::placeholders::_5);
36     test<6>(std::placeholders::_6);
37     test<7>(std::placeholders::_7);
38     test<8>(std::placeholders::_8);
39     test<9>(std::placeholders::_9);
40     test<10>(std::placeholders::_10);
41     test<0>(4);
42     test<0>(5.5);
43     test<0>('a');
44     test<0>(C());
45 }
46