equivariant functions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Oct 12 14:17:36 PDT 2008


Denis Koroskin wrote:
> May I suggest one of my personal preference? Here it is:
> 
> sameconst(char)* strstr(sameconst(char)* str1, const(char)* str2)
> {
>     return str2; // compile-time error. Can't cast const(char)* to 
> sameconst(char)* implicitly
> }

I prefer my solution because it's more general and addresses more issues 
than passing the qualifier out.

Andrei



More information about the Digitalmars-d mailing list