Perfect forwarding

Petar Petar
Wed Jul 29 16:11:02 UTC 2020


On Wednesday, 29 July 2020 at 12:54:36 UTC, Adam D. Ruppe wrote:
> On Wednesday, 29 July 2020 at 10:38:29 UTC, Manu wrote:
>> On Wed, Jul 29, 2020 at 9:40 AM Jean-Louis Leroy via
>>> Guaranteed failure then? ;-)
>>
>> Yes.
>
> What's wrong with my solution earlier in the thread?

That it uses a string mixin :P

What Manu is arguing is that if parameter storage classes were 
instead proper type qualifiers, then one could trivially 
manipulate them with std.meta. And then supposedly there would be 
no need to string mixins at all.
I haven't spent the time to actually verify if that's the case 
here (perhaps the only need for using a string mixin is to 
generate variable names like Param1, Param2, ... ParamN) as is(X 
== __parameters) solves the issue with forwarding the whole 
parameter list (including storage classes), but in general, this 
doesn't scale if you need to do type manipulation with std.meta, 
as `alias RefInt = ref int` drops the `ref` storage class and 
this breaks everything like staticMap, Filter, etc.


More information about the Digitalmars-d mailing list