3 ms·
So when I mentioned the traditional benefits of OO, it didn't occur to you that polymorphism was one of them? Okay... >private, unimplmented copy constructor a
by Kranar 6y ago
So when I mentioned the traditional benefits of OO, it didn't occur to you that polymorphism was one of them? Okay...
>private, unimplmented copy constructor and assignment operator
If you're using C++11 or better, then avoid doing that. In modern C++ you declare those as deleted.
>If I had to do your Cat example, I'd probably have Animal's copy constructor call a protected pure virtual clone() method.
This would do absolutely nothing and once again, despite you claiming to have 25 years of professional experience in C++, I must shake my head to even hear such a thing.
All I get from this conversation is that you have a very antiquated idea of how to use C++ and have not kept up to date with modern standards. You mention the rule of 3, which is a pre-C++11 idiom and superseded by the rule of 5 with the advent of move constructors (or the rule of 0). Yet despite this you felt it appropriate to claim that since you personally have never encountered any recent advancement in C++ in the past decade, that it must be me who is distorting the situation.
It could not possibly be the case that the C++ of today is much different from the C++ back in 1996 when you started using it, nor could it possibly be that using C++ for embedded development represents only a tiny subset of how C++ is used, or that maybe you just aren't familiar with something because no one is an expert in everything and we have to prioritize what we spend our time learning. No... the conclusion you chose to go with is that I'm distorting reality because you happen to lack any modern knowledge about a technology that you claim to have 25 years of experience with.
Hate to break it to you... but it's not the 90s anymore.