]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_part_spec_def_args.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_part_spec_def_args.ipp
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
12 namespace boost_no_partial_specialization_implicit_default_args{
13
14 template <class T>
15 struct one
16 {
17 };
18
19 template <class T1, class T2 = void>
20 struct tag
21 {
22 };
23
24 template <class T1>
25 struct tag<one<T1> >
26 {
27 };
28
29 template <class T>
30 void consume_variable(T const&){}
31
32 int 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