• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//  (C) Copyright Mathias Gaunard 2009.
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 the most recent version.
7
8//  MACRO:         BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
9//  TITLE:         Default template arguments for function templates
10//  DESCRIPTION:   Default template arguments for function templates are not supported.
11
12namespace boost_no_cxx11_function_template_default_args
13{
14
15template<typename T = int>
16T foo()
17{
18    return 0;
19}
20
21template<typename T, typename U>
22bool is_same(T, U)
23{
24    return false;
25}
26
27template<typename T>
28bool is_same(T, T)
29{
30    return true;
31}
32
33int test()
34{
35   return !is_same(foo<>(), 0) || is_same(foo<>(), 0L);
36}
37
38} // namespace boost_no_function_template_default_args
39