• 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_MEMBER_TEMPLATE_KEYWORD
9//  TITLE:         member templates keyword
10//  DESCRIPTION:   Member template keyword not supported.
11
12namespace boost_no_member_template_keyword{
13
14#ifndef BOOST_NO_MEMBER_TEMPLATES
15
16template <class T>
17struct foo
18{
19   template <class U>
20   struct nested
21   {
22      typedef foo<U> other;
23   };
24   template <class U>
25   void mfoo(const U&);
26};
27
28template <class T>
29template <class U>
30void foo<T>::mfoo(const U&)
31{
32}
33
34template <class T>
35void test_proc(T i)
36{
37   foo<double> f1;
38   typedef foo<T> ifoo;
39   f1.mfoo(i);
40   f1.template mfoo<T>(i);
41   typedef typename ifoo::template nested<double> bound_t;
42   typedef typename bound_t::other other;
43   other o;
44   (void) &o;         // avoid "unused variable" warning
45}
46
47#else
48template <class T>
49void test_proc(T)
50{
51}
52#endif
53
54int test()
55{
56   test_proc(0);
57   return 0;
58}
59
60
61}
62
63
64
65
66
67
68
69
70