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_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS 9// TITLE: non-deduced function template parameters 10// DESCRIPTION: Can only use deduced template arguments when 11// calling function template instantiations. 12 13#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1200) 14#error "This is known to be buggy under VC6" 15#endif 16 17 18namespace boost_no_explicit_function_template_arguments{ 19 20struct foo 21{ 22 template<class T> int bar(){return 0;} 23 template<int I> int bar(){return 1;} 24}; 25 26int test_0() 27{ 28 return 0; 29} 30 31 32template <int i> 33bool foo_17041(int j) 34{ 35 return (i == j); 36} 37 38int test() 39{ 40 foo f; 41 int a = f.bar<char>(); 42 int b = f.bar<2>(); 43 if((a !=0) || (b != 1))return -1; 44 45 if(0 == foo_17041<8>(8)) return -1; 46 if(0 == foo_17041<4>(4)) return -1; 47 if(0 == foo_17041<5>(5)) return -1; 48 return 0; 49} 50 51} 52 53 54 55 56