[context] Compiling error with context and bind
On Tue, Sep 9, 2014 at 4:47 PM, José
I changed the example jump.cpp from Context library to use a class, with fcontext_t as an attribute. I wrote the code below, but I can't compile it because there is an error in the use of boost::bind.
What can be happening?
foo->fc1 = ctx::make_fcontext( base1, stack_allocator::default_stacksize(), boost::bind(&FooClass::f1, foo, _1 ));
The documented signature of make_fcontext() accepts a classic C function pointer: http://www.boost.org/doc/libs/1_56_0/libs/context/doc/html/context/context/b... boost::bind() does not produce a classic C function pointer. Boost.Context is a very low-level library, with distinct platform-specific assembler implementations for various combinations of OS and hardware. Boost.Coroutine is a more C++-level API built on Boost.Context, and Coroutine almost certainly what you should be using unless your requirements are pretty unusual.
participants (2)
-
José
-
Nat Goodspeed