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_MSVC6_MEMBER_TEMPLATES 9// TITLE: microsoft member templates 10// DESCRIPTION: Microsoft Visual C++ 6.0 has enough member 11// template idiosyncrasies (being polite) that 12// BOOST_NO_MEMBER_TEMPLATES is defined for this compiler. 13// BOOST_MSVC6_MEMBER_TEMPLATES is defined to allow 14// compiler specific workarounds. 15#ifndef BOOST_NESTED_TEMPLATE 16#define BOOST_NESTED_TEMPLATE template 17#endif 18 19namespace boost_msvc6_member_templates{ 20 21template <class T> 22struct foo 23{ 24 template <class U> 25 struct nested 26 { 27 typedef foo<U> other; 28 }; 29 template <class U> 30 void mfoo(const U&) 31 { 32 } 33}; 34 35template <class T> 36void vc6_mem_test(T i) 37{ 38 foo<double> f1; 39 typedef foo<T> ifoo; 40 f1.mfoo(i); 41 typedef typename ifoo::BOOST_NESTED_TEMPLATE nested<double> bound_t; 42 typedef typename bound_t::other other; 43 other o; 44 (void)o; 45} 46 47int test() 48{ 49 int i = 0; 50 vc6_mem_test(i); 51 return 0; 52} 53 54} 55 56 57 58 59