3 ms·
There's plenty you can do with D but not C++, see regex, bitfields, swap member-by-member with checks for mutual pointers, the pegged library for grammars, etc
by jacques_chirac 9y ago
There's plenty you can do with D but not C++, see regex, bitfields, swap member-by-member with checks for mutual pointers, the pegged library for grammars, etc etc.
- jordigh 9y agoI don't know, Boost has me convinced that even things like regexes in C++ templates could be possible, if your compiler has a big enough stack to handle very deep template recursions. It's theoretically possible to build a regex parser in C++ templates, right? It would be horrible, but possible.
- humanrebar 9y ago> It's theoretically possible to build a regex parser in C++ templates, right? You'd probably do large portions of it in "constexpr" types and functions rather than relying on recursive metaprogramming techniques. They are also planning on adding overloading based on whether a function is constexpr, which is important if you want the same library to support both compile-time and run-time matchers. So it's all theoretically possible already. But D has the advantage here in that it's not just possible but usable.
- qznc 9y agoWith D it is possible and not horrible and already done. ;) Talk: http://dconf.org/2014/talks/olshansky.html http://dconf.org/2014/talks/olshansky.html