Improve vacpp support.
[boost.git] / boost / libs / config / test / boost_no_dep_nested_class.ipp
blob42c5750305ee4dc4358303aa12af0c54ba360983
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)
6 //  See http://www.boost.org/libs/config for most recent version.
8 //  MACRO:         BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
9 //  TITLE:         dependent nested template classes
10 //  DESCRIPTION:   The compiler fails to compile
11 //                 a nested class that has a dependent base class:
12 //                 template<typename T>
13 //                 struct foo : {
14 //                    template<typename U>
15 //                    struct bar : public U {};
16 //                 };
17 #ifndef BOOST_NESTED_TEMPLATE
18 #define BOOST_NESTED_TEMPLATE template
19 #endif
22 namespace boost_no_dependent_nested_derivations{
24 struct UDT1{};
25 struct UDT2{};
27 template<typename T> 
28 struct foo 
30   template<typename U> 
31   struct bar : public foo<U> 
32   {};
35 template <class T>
36 void foo_test(T)
38    typedef foo<T> foo_type;
39    typedef typename foo_type::BOOST_NESTED_TEMPLATE bar<UDT2> bar_type;
40    foo<T> ft;
41    bar_type bt;
42    (void) &bt;
43    (void) &ft;
46 int test()
48    foo_test(UDT1());
49    return 0;