Boost logo

Boost Users :

From: Howard Gardner (hgardner_at_[hidden])
Date: 2006-04-21 08:26:06


/*
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 );
   }


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net