Boost logo

Boost :

Subject: Re: [boost] [Functional/Factory] Value factory not accepts rvalues?
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2013-11-12 05:34:36

On Nov 12, 2013, at 2:34 AM, "Lin, Yi-Li" <record.nctu.cis91_at_[hidden]> wrote:

> Sample code which compiler complains:
> int get_value();
> struct var {
> var( );
> explicit var(int);
> };
> void caller() {
> boost::value_factory<var> f;
> f(get_value());
> }

You don't show the error message, and I know nothing about value_factory, but var's converting constructor is explicit, so the int returned by get_value() cannot be converted to a var implicitly in the call of f.

Perhaps you misinterpreted the error?


(Sent from my portable computation engine)

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