is_placeholder.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
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// struct is_placeholder
13
14#include <functional>
15
16template <int Expected, class T>
17void
18test(const T&)
19{
20    static_assert(std::is_placeholder<T>::value == Expected, "");
21}
22
23struct C {};
24
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