On Tuesday, 26 June 2018 at 22:16:28 UTC, Jonathan M Davis wrote:
If what you're asking is whether it's possible for a template
constraint that uses something like isSomeString will ever
match a user-defined type, then the answer is no.
Thats exactly what I wanted xD.
My idea was that if
n Tuesday, June 26, 2018 17:14:08 SrMordred via Digitalmars-d-learn wrote:
> Is possible to make a Custom Struct String work for D string
> constraints?
>
> eg:
>
> struct MyString
> {
> char[] arr;
> alias arr this;
> }
>
> void getString( char[] str ){}
>
> MyString().split(";");
Is possible to make a Custom Struct String work for D string
constraints?
eg:
struct MyString
{
char[] arr;
alias arr this;
}
void getString( char[] str ){}
MyString().split(";"); //oops, type mismatch
getString( MyString() ); //fine, implicit conversion