@cmuratori thought you might like this: C++11 swap w/o tmplts
#define SWAP_VALS(v0, v1) { \
decltype(v0) t = v0; \
v0 = v1; \
v1 = t; \
}
-
-
Replying to @sssmcgrath
@DyadGame It's about time they finally had a way to get a variables type! I will probably start using that... that is a useful feature.1 reply 0 retweets 0 likes -
Replying to @cmuratori
@cmuratori Yeah, I just discovered decltype() and wrote that swap macro. I haven't thought about the myriad of things you could with it yet1 reply 0 retweets 0 likes -
Replying to @sssmcgrath
@DyadGame I've found myself wanting it on many occasions over the years, and of course C++ never had it because they were too busy sucking.1 reply 0 retweets 1 like -
Replying to @cmuratori
@cmuratori A couple of the new C++11 features are useful. decltype/auto, typed enums... that's about it. ie: enum Ename : ubyte... or smthng1 reply 0 retweets 0 likes -
Replying to @sssmcgrath
@DyadGame "auto" seemed like it could save some time as well - ie., where you just let the return type of a function imply the receiver var.1 reply 0 retweets 0 likes -
Replying to @cmuratori
@cmuratori Yeah, I listed that... I use it so infrequently though. I think it solves some problems that templates create, but not much else1 reply 0 retweets 0 likes
@DyadGame Yeah, it doesn't really solve problems, just saves some typing, probably.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.