• 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_USING_TEMPLATE
9//  TITLE:         using template declarations
10//  DESCRIPTION:   The compiler will not accept a using declaration
11//                 that imports a class or function template
12//                 into a named namespace.  Probably Borland/MSVC6 specific.
13
14template <class T>
15int global_foo(T)
16{
17   return 0;
18}
19
20template <class T, class U = void>
21struct op
22{
23   friend op<T,U> operator +(const op&, const op&)
24   {
25      return op();
26   };
27};
28
29namespace boost_no_using_template{
30
31using ::global_foo;
32using ::op;
33
34int test()
35{
36   boost_no_using_template::op<int, int> a;
37   boost_no_using_template::op<int, int> b;
38   a+b;
39   return boost_no_using_template::global_foo(0);
40}
41
42}
43
44
45
46
47
48