21 Apr
2006
21 Apr
'06
12:26 p.m.
/* This doesn't work. Is it supposed to? If "broken" returns a "ret< int >" or an "x", then it does seem to work right. In case it's a known compiler issue, I'm using: Comeau C/C++ 4.3.3 (Aug 10 2003 15:39:53) for _MS_WINDOWS_x86_Beta8 */ #include "boost/function.hpp" using namespace boost; #include<ostream> using namespace std; template< typename x > struct ret{}; template< typename x > ret< x > broken( x f ) { cout << f << endl; return ret< x >(); } int main() { // function1< ret< int >, int > func; same problem function< ret< int > ( int ) > func = broken< int >; func( 42 ); }