3 ms·
> Oh, nice. It's hopeless for C/C++ for legacy reasons, but D - that could work. What in particular do you think would be impossible in C++ for legacy reasons
by w-m 7y ago
> Oh, nice. It's hopeless for C/C++ for legacy reasons, but D - that could work.
What in particular do you think would be impossible in C++ for legacy reasons?
From a very high level it seems to me that all the necessary ingredients of this solution are available in C++ (> C++11) as well. There are pointers, smart pointers, references, constness and move semantics for the ownership and borrowing. There are [[attributes]] for the method-selective opt-in.
There is of course always the argument of not making C++ compilers even more complex. But is there some actual technical limitation in fitting the same idea into C++?
- pjmlp 7y agoYou need to prevent copy-paste compatibility with C like code, which is kind of possible with static analysers, but even then only over the source code you have access to, forbading any 3rd party libraries. So unless you get the buy-in from the whole team, it hardly works across big projects.