• 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_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
9//  TITLE:         dependent non-type template parameters
10//  DESCRIPTION:   Template value parameters cannot have a dependent
11//                 type, for example:
12//                 template<class T, typename T::type value>
13//                 class X { ... };
14
15
16namespace boost_no_dependent_types_in_template_value_parameters{
17
18template <class T, typename T::type value = 0>
19class X
20{};
21
22template <class T>
23struct typifier
24{
25   typedef T type;
26};
27
28int test()
29{
30   X<typifier<int> > x;
31   (void) &x;        // avoid "unused variable" warning
32   return 0;
33}
34
35}
36
37
38