Microsoft has been busy implementing a new type of operators in C++ called "tadpole" operators (named so because they look like ASCII tadpoles).
Microsoft has been busy implementing a new type of operators in C++ called "tadpole" operators (named so because they look like ASCII tadpoles).
These will allow you to save a large number of parantheses that you would otherwise have to write due to operator precedence.
More information here:
http://blogs.msdn.com/b/oldnewthing/archive/2015/05/25/10616865.aspx
Of course Microsoft is behind the times on this and this has been possible in delphi for a long time.
Examples:
WriteLn(not - 5);
> Prints "4"
WriteLn( not 5);
-> Prints "6"
As usual though the Delphi syntax is more verbose than the cleaner C++ implementation.
http://blogs.msdn.com/b/oldnewthing/archive/2015/05/25/10616865.aspx
These will allow you to save a large number of parantheses that you would otherwise have to write due to operator precedence.
More information here:
http://blogs.msdn.com/b/oldnewthing/archive/2015/05/25/10616865.aspx
Of course Microsoft is behind the times on this and this has been possible in delphi for a long time.
Examples:
WriteLn(not - 5);
-> Prints "6"
As usual though the Delphi syntax is more verbose than the cleaner C++ implementation.
http://blogs.msdn.com/b/oldnewthing/archive/2015/05/25/10616865.aspx
These are... odd?
ReplyDeleteLOL. Took me a while... ;-) Well played.
ReplyDeleteThe define is meaningless... because ~ would work anyway...? I'm confused.
ReplyDeleteSeems a joke post, but a really weird one.
Ondrej Kelle If you "get" it, please illuminate :)
David Millington Yes, both ~ and - are unary operators, one's complement and negation, respectively. So ~-x already works as (x - 1), and -~x as (x + 1).
ReplyDeleteYeah. So... maybe I'm missing the point of the post, here and on MSDN. If you "get" it, can you explain please?
ReplyDeleteVery simple: Troll. :-) See the reactions in the comments.
ReplyDeleteI suppose I got trolled too then :)
ReplyDeleteAnd the explanation : http://blogs.msdn.com/b/oldnewthing/archive/2015/05/26/10617079.aspx
ReplyDelete