@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; \
}
@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.
-
-
@cmuratori Yeah, I just discovered decltype() and wrote that swap macro. I haven't thought about the myriad of things you could with it yet -
@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. - Show replies
New conversation -
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.