Random Suggestion: Swap Operator <=>?

Walter Bright newshound1 at digitalmars.com
Fri Jul 17 15:49:58 PDT 2009


Ary Borenszweig wrote:
> Oh, come on, It's just three lines of code! And it's not *that* common. 
> I know it's kind of basic and primitive, but there's a standard library 
> function for it. Why add an operator *just* for that?

A request for a swap operators comes up now and then in the C/C++ forums 
as well. The answer given, which applies to D as well, is that:

1. it is too rarely used to merit a special operator just for it

2. it is handled adequately with library code or even just inlining it



More information about the Digitalmars-d mailing list