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