Boost logo

Boost :

Subject: Re: [boost] Boost.Fiber review January 6-15
From: Nat Goodspeed (nat_at_[hidden])
Date: 2014-01-21 21:39:59

On Wed, Jan 15, 2014 at 8:56 PM, Agustín K-ballo Bergé
<kaballo86_at_[hidden]> wrote:

> - The lack of a variadic constructor for `fiber` and variadic arguments for
> `async` makes it difficult to use the library correctly (even in the
> presence of C++14 lambdas). The semantic of those calls is that of a
> deferred call, which is difficult to achieve otherwise (note that `bind`
> doesn't help here).

The review report (which I am writing now!) does not depend on my
understanding this point, but on rereading your mail I realized I do
not yet understand it. In my (obviously incomplete) mental model, a
hypothetical fiber constructor:

fiber f(some_callable, 3.14, "a string", 17);

would be completely equivalent to:

fiber f(bind(some_callable, 3.14, "a string", 17));

What am I missing? (If this is already well-explained elsewhere, I
would appreciate a pointer as much as your own explanation.)

Oliver may well understand your point already. But if you asked me to
implement a variadic fiber constructor (and async() function), I would
immediately forward to bind() inside each. Would that be a sufficient
implementation? If not, why not?

A broader question to those who requested a variadic fiber constructor
(and async()): is it sufficient to provide that support only when the
compiler supports variadic templates, or are you asking for the whole
ugly C++03 workaround as well?

Boost list run by bdawes at, gregod at, cpdaniel at, john at