• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
20namespace boost_no_function_template_ordering{
21
22template<typename T>
23bool f(T)
24{
25   return false;
26}
27
28template<typename T, typename U>
29bool f(T (*)(U))
30{
31   return true;
32}
33
34void bar(int)
35{
36}
37
38int test()
39{
40   int i = 0;
41   return f(i) || !f(&bar);
42}
43
44}
45
46
47
48
49
50