Difference between "can call" and "can compile"

WebFreak001 d.forum at webfreak.org
Wed Sep 16 05:58:01 UTC 2020

On Tuesday, 15 September 2020 at 19:12:04 UTC, Steven 
Schveighoffer wrote:
> On 9/15/20 10:18 AM, WebFreak001 wrote:
>> [...]
> But that's the issue. If I know what small set of types should 
> work, then I can just write overloads for those types.
> It's when I don't know what type is going to be passed in.
> I could probably switch to using "hasMember" in this use case, 
> which is likely to be correct for all purposes that I have. 
> It's just not applicable to a public library, which might use 
> things other than members.
> -Steve

huh where did you get that from? My proposed solution there just 
checks if you can call a function with the given arguments only 
if it's passing all the template constraints.

More information about the Digitalmars-d mailing list