• 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_TEMPLATE_PARTIAL_SPECIALIZATION
9//  TITLE:         partial specialisation
10//  DESCRIPTION:   Class template partial specialization
11//                 (14.5.4 [temp.class.spec]) not supported.
12
13
14namespace boost_no_template_partial_specialization{
15
16template <class T>
17struct partial1
18{
19   typedef T& type;
20};
21
22template <class T>
23struct partial1<T&>
24{
25   typedef T& type;
26};
27
28template <class T, bool b>
29struct partial2
30{
31   typedef T& type;
32};
33
34template <class T>
35struct partial2<T,true>
36{
37   typedef T type;
38};
39
40
41int test()
42{
43   int i = 0;
44   partial1<int&>::type p1 = i;
45   partial2<int&,true>::type p2 = i;
46   (void)p1;
47   (void)p2;
48   (void)i;
49   return 0;
50}
51
52}
53
54
55
56
57