Type functions with std.algorithm

Stefan Koch uplink.coder at googlemail.com
Mon Oct 12 08:56:50 UTC 2020


On Sunday, 11 October 2020 at 16:53:25 UTC, Timon Gehr wrote:
> On 11.10.20 17:46, Stefan Koch wrote:
>> On Sunday, 11 October 2020 at 13:49:20 UTC, Stefan Koch wrote:
>>>
>>> So all I have to do is to teach that the type of any type is 
>>> __type.
>>>
>>> And then everything will work!
>> 
>> Turns out that is not the case now array fails with:
>> phobos/std/conv.d(4529): Error: constructor 
>> std.conv.emplaceRef!(__type, __type, 
>> __type).emplaceRef.S.this(ref __type _param_0) is not callable 
>> using argument types ((__type))
>> 
>> I believe this is an implicit conversion problem ...
>
> Probably the compiler thinks that you are calling the function 
> with an rvalue:
>
> ---
> void foo(ref int){}
> void main(){ foo(2); }
> ---
> test.d(2): Error: function `test.foo(ref int _param_0)` is not 
> callable using argument types `(int)`
> ---

Thanks for the pointer.

I hope to fix this bug soon.


More information about the Digitalmars-d mailing list