Operator Overloading + / ~
ketmar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jun 19 05:22:43 PDT 2017
Martin Tschierschke wrote:
> Just a thought it might be useful for cut-n-paste when porting code:
>
> Would it be possible to define an operator overloading for '+'-Operator
> for strings to work as append? (like ~).
> I understand, that '~' is in general a better choice than '+', so this is
> of more theoretical interest.
> It is clear to me, that when I define my own string type this is possible.
>
> Regards mt.
nope. it is not possible to overload operators for built-in types (and
string is just an aliased array).
More information about the Digitalmars-d-learn
mailing list