]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_func_tmp_order.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_func_tmp_order.ipp
1 // (C) Copyright John Maddock 2001.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 // See http://www.boost.org/libs/config for most recent version.
7
8 // MACRO: BOOST_NO_FUNCTION_TEMPLATE_ORDERING
9 // TITLE: no function template ordering
10 // DESCRIPTION: The compiler does not perform
11 // function template ordering or its function
12 // template ordering is incorrect.
13 //
14 // template<typename T> void f(T); // #1
15 // template<typename T, typename U> void f(T (*)(U)); // #2
16 // void bar(int);
17 // f(&bar); // should choose #2.
18
19
20 namespace boost_no_function_template_ordering{
21
22 template<typename T>
23 bool f(T)
24 {
25 return false;
26 }
27
28 template<typename T, typename U>
29 bool f(T (*)(U))
30 {
31 return true;
32 }
33
34 void bar(int)
35 {
36 }
37
38 int test()
39 {
40 int i = 0;
41 return f(i) || !f(&bar);
42 }
43
44 }
45
46
47
48
49