3 ms·
Build-in sum types and pattern matching are the major missing features. Instead C++17 will have library hacks like std::variant, that almost certainly will be
by octoploid 10y ago
Build-in sum types and pattern matching are the major missing features.
Instead C++17 will have library hacks like std::variant, that almost certainly will be deprecated for C++20.
- hellofunk 10y agoThey would be deprecated only if the features you are missing are actually on their way into the language. Are they? I agree those features would be nice, but I've never seen any mention of them actually planned.
- octoploid 10y agoSee: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0095r1.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p009...
- revelation 10y agoModules seem much more important than either of those. You know where you include a platform header and suddenly you can no longer call a variable "min" because said platform header decided that should be a macro and it's giving you cryptic errors because what you see isn't what the compiler sees. I've written too much C++ to be dumbfounded by that stuff but that doesn't mean I'm not still bitter about it.
- gpderetta 10y agoWhat platform would ever put a three letter macro in its base headers! That would be stupid. /s
- maccard 10y agoIn fairness, It's a well documented problem with a ery easy solution. I wonder how much code would break if they removed it..
- loup-vaillant 10y ago> Modules seem much more important than either of those. Modules solve an immediate and obvious pain: unacceptably long compile times. Sum types are more profound. Anyone having tasted an ML derivative (as I have) would dearly miss them. Seriously, once you've tasted sum types, you'll want to use them everywhere: option types, error returns, abstract syntax trees (JSON, XML, compilers…), you name it, sum types probably solve it. Sum types are no panacea, but if you squint your eyes just right they're pretty damn close.
- revelation 10y agoI've tasted sum types and if I was trying to be snarky I'd say so have millions of Java enterprise developers who fill their code with a healthy dose of instanceof and null :) It is somewhat anathema to the OO idea and brings lots of (runtime) implementation concerns so I can understand the delay.
- tines 10y agoWhy would variant be deprecated for C++20?