Boost logo

Boost :

Subject: Re: [boost] Formale Review: Callable Traits
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-04-10 23:51:11

On 11/04/2017 06:48, Peter Dimov via Boost wrote:
> Getting the arguments as a tuple that includes the class type as a first
> parameter raises the obvious question of
> void(foo::*)(float, char, int) -> tuple<foo&, float, char, int>
> void(foo::*)(float, char, int) & -> tuple<foo&, float, char, int>
> I understand why that is, but it still makes args lossy and the original
> can't be recreated from the tuple. Trailing varargs also have the same
> problem, as (float) and (float, ...) map to the same tuple.
> The obvious theoretically consistent approach here is
> void(foo::*)(float, char, int) -> tuple<foo, float, char, int>
> and
> void(float, ...) -> tuple<float, ct::varargs_t>
> which would be fully reversible but could possibly be less convenient in
> practice.

Perhaps in the first case it should specify a pointer type instead?
That seems reasonably natural to me as the actual type of the "this"
parameter, though I don't have any standardese in particular to back
that up.

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