1//  (C) Copyright John Maddock 2008.
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_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
9//  TITLE:         Default arguments in partial specialization
10//  DESCRIPTION:   The compiler chokes if a partial specialization relies on default arguments in the primary template.
11
12namespace boost_no_partial_specialization_implicit_default_args{
13
14template <class T>
15struct one
16{
17};
18
19template <class T1, class T2 = void>
20struct tag
21{
22};
23
24template <class T1>
25struct tag<one<T1> >
26{
27};
28
29template <class T>
30void consume_variable(T const&){}
31
32int test()
33{
34   tag<int> t1;
35   consume_variable(t1);
36   tag<one<int> > t2;
37   consume_variable(t2);
38   tag<int, double> t3;
39   consume_variable(t3);
40   tag<one<int>, double> t4;
41   consume_variable(t4);
42   return 0;
43}
44
45}
46
47