3 ms·
Unfortunately that means they lack lots of the pattern matching niceties that you get in languages with builtin ADTs. There is an impressive paper about impleme
by bjz_ 10y ago
Unfortunately that means they lack lots of the pattern matching niceties that you get in languages with builtin ADTs. There is an impressive paper about implementing pattern matching on sub-classes, but it's pretty hackily done using the preprocessor, and could definitely do with some language support: http://www.stroustrup.com/OpenPatternMatching.pdf http://www.stroustrup.com/OpenPatternMatching.pdf
- hellofunk 10y agoIt is widely speculated that pattern matching and many other syntactic enhancements are coming to C++ because of the big door that std::variant has opened.
- deleted 10y ago[deleted]
- squidbidness 10y agoIIRC Stroustrup mentions a desire for features such as these for versions of C++ after C++17.
- MichaelMoser123 10y agoC++11 c++14 c++17 does that mean that we might see a match statement in c++20? It would be a significant addition - similar in complexity to anonymous functions.
- MichaelMoser123 10y agoi remember that Bjarne Stroustrup held a talk in cppcon15 where he talked a lot about the GSL library [1] - it would add type annotations that can be checked by a tool, so as to check for potential memory problems (to me that sounds like a poor man's borrow checker). One year later: i see the template library [1] but i don't see the analysis tool. Does anybody know what happened with this initiative? [1] https://www.youtube.com/watch?v=1OEu9C51K2A https://www.youtube.com/watch?v=1OEu9C51K2A [2] https://github.com/Microsoft/GSL https://github.com/Microsoft/GSL
- pjmlp 10y agoThe tools are called clang tidy and Visual Studio 2015 Update 3. Other vendors might eventually add support as well.