Boost logo

Boost Users :

Subject: Re: [Boost-users] [context] Compiling error with context and bind
From: Nat Goodspeed (nat_at_[hidden])
Date: 2014-09-09 16:57:14


On Tue, Sep 9, 2014 at 4:47 PM, José <josessantos_at_[hidden]> wrote:

> 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/boost_fcontext.html
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.


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