1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
// MACRO: BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// TITLE: partial specialisation
// DESCRIPTION: Class template partial specialization
// (14.5.4 [temp.class.spec]) not supported.
namespace boost_no_template_partial_specialization{
template <class T>
struct partial1
{
typedef T& type;
};
template <class T>
struct partial1<T&>
{
typedef T& type;
};
template <class T, bool b>
struct partial2
{
typedef T& type;
};
template <class T>
struct partial2<T,true>
{
typedef T type;
};
int test()
{
int i = 0;
partial1<int&>::type p1 = i;
partial2<int&,true>::type p2 = i;
(void)p1;
(void)p2;
(void)i;
return 0;
}
}