Boost logo

Boost :

Subject: Re: [boost] [Fit] Update: Request for feedback
From: Paul Fultz II (pfultz2_at_[hidden])
Date: 2017-02-06 09:39:12


> On Feb 5, 2017, at 5:12 PM, Fletcher, John P <j.p.fletcher_at_[hidden]> wrote:
>
> Paul
>
> I have been checking out my old examples against the latest version of the FIT code.
>
> It appears that examples like this which us .by have gone from the test file construct.cpp:
>
> auto make = fit::construct<std::vector<int>>().by(fit::_1 * fit::_1);
>
> This appears to be a removal of the by adaptor from construct.
>
> Is there documentation of this and any other such changes?

The usage .by was never really documented. It was originally there to make it easier support things like `construct<T>().by(decay)` to construct by value. However, the interface has changed to make it more consistent with the rest of the library. So now `construct<T>()` will construct by value, whereas `construct_basic<T>()` has the original behavior. Of course, this difference only matters when constructing templates.

>
> Is there a new way to do the same thing?

The .by method was just a shortcut for the by adaptor, so it can be written as `by(_1 * _1, construct<std::vector<int>>())`

Paul


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