This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Simplify a tad _Bind<_Functor(_Bound_args...)>
2010/1/15 Jonathan Wakely:
> 2010/1/15 Paolo Carlini:
>> Hi all, Jon,
>>
>> I'm thinking of simplifying a bit the recently introduced mechanism like
>> this. Can you imagine anything wrong with it? Passes regtesting, of course.
>
> I thought about doing that, but never tried it. ?I think it should be
> OK (but if we have to revert <functional> then it's moot anyway.)
>
>> As a side note, I think it would be really nice if we could use *only*
>> result_of instead, thus hiding declval tricks, but I don't think it's
>> feasible, did you try hard Jon?
>
> I tried - but I don't think it's possible with the current definition
> of result_of, but might be with the proposed resolution of LWG 1225
>
> I could be wrong though, I hit so many obstacles implementing that
> code, and often wasn't sure if the problem was with g++, the
> definition in the standard, or just my own limitation to write the
> code correctly.
N.B. another variation I tried (but didn't use, as it seemed to have
no clear benefit) was to "un-overload" call() so that:
operator()(...) uses call(...)
operator()(...) const uses call_c(...) const
operator()(...) volatile uses call_v(...) volatile
and operator()(...) const volatile uses call_cv(...) const volatile
This would mean that once overload resolution has decided which
operator() to use, it doesn't then have to decide which call() member
to use, because (IIRC) the second overload resolution goes through the
same instantiations and argument deductions as the first overload
resolution, which I think is unnecessary.