• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//  (C) Copyright John Maddock 2002.
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_TEMPLATES
9//  TITLE:         template template paramters.
10//  DESCRIPTION:   Verify that template template parameters both work
11//                 and can be deduced through a function call.
12
13
14namespace boost_no_template_templates{
15
16
17template<class T>
18class foo
19{
20public:
21   foo(){};
22   foo(const T&){};
23   const foo& bar()const{ return *this; }
24   foo& operator=(const foo&){ return *this; }
25};
26
27template<typename T, template<typename> class U>
28U<T> sinhc_pi(const U<T> x)
29{
30   return x.bar();
31}
32
33
34int test()
35{
36   foo<double> f1;
37   foo<int> f2;
38   f1 = sinhc_pi(f1);
39   f2 = sinhc_pi(f2);
40   return 0;
41}
42
43
44}
45
46
47
48
49
50
51