Boost logo

Boost :

From: Yitzhak Sapir (yitzhaks_at_[hidden])
Date: 2002-05-23 07:11:26


This works with my compiler MSVC6.5 using the just released 1.28 library. We haven't moved to it yet though. In the older version library it doesn't work though.

I'm still somewhat interested in whether pointers to functors are useful. But I suppose it's less important if I can use boost::ref.

> I have tried the following on my compiler and it worked perfectly:
>
> #include <boost/function.hpp>
> #include <boost/ref.hpp>
>
> void func(boost::function0<void> f) { f(); }
>
> struct functor
> {
> void operator()() {std::cout << "It works!" << std::endl; }
> };
>
> int main()
> {
> functor f;
> func(f);
> func(boost::ref(f));
> }
>
> Output:
> It works!
> It works!
>
> If this doesn't work for you, then is my logic (and my
> compiler) flawed?
>
> Dirk Gerrits
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk