ptr_fun and functions returning void 
Author Message
 ptr_fun and functions returning void

Has anyone had any luck specializing the pointer_to_unary_function to
handle functions that return void?  I've tried this:

 // TEMPLATE CLASS pointer_to_unary_function
template<class _A>
class pointer_to_unary_function<_A, void>
  : public unary_function<_A, void>
{
public:
 explicit pointer_to_unary_function(void (__cdecl *_X)(_A))
  : _Fn(_X) {}
 void operator()(_A _X) const
  { _Fn(_X); }
protected:
 void (__cdecl *_Fn)(_A);

Quote:
};

but no luck.

Michael Herstine



Mon, 16 Apr 2001 03:00:00 GMT  
 ptr_fun and functions returning void

Quote:

>Has anyone had any luck specializing the pointer_to_unary_function to
>handle functions that return void?  I've tried this:

It's a known problem, which can be solved once VC++ supports
partial specialization. For now, you have to craft your own
pointer_to_unary_function_returning_void.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com/hot_news.html



Mon, 16 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. return in a void function

2. One void function returning another?

3. function pointer returning const * incompatible with void *?

4. explicit return in void function()

5. return values and void functions

6. void function return?

7. return from void function?

8. Q: casting to a pointer to a function returning void

9. Summary: Return in void function

10. calling a function w/ void return type in c#

11. ptr_fun - template function problem.

12. ptr_fun() and static function

 

 
Powered by phpBB® Forum Software