Type functions with std.algorithm

Timon Gehr timon.gehr at gmx.ch
Sun Oct 11 16:53:25 UTC 2020


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)`
---


More information about the Digitalmars-d mailing list