1// (C) Copyright Eric Friedman 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// MACRO: BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE 7// TITLE: using declaration function overloads from a typename base 8// DESCRIPTION: The compiler will not accept a using declaration 9// that brings a function from a typename used as a base class 10// into a derived class if functions of the same name 11// are present in the derived class. 12 13namespace boost_no_using_declaration_overloads_from_typename_base { 14 15struct base 16{ 17 static void f() { } 18}; 19 20template <typename T, typename Base> 21struct using_overloads_from_typename_base : Base 22{ 23 using Base::f; 24 static T f(const T& t) { return t; } 25}; 26 27int test() 28{ 29 using_overloads_from_typename_base<int,base>::f(); 30 return using_overloads_from_typename_base<int,base>::f(0); 31} 32 33} 34