'Why is std::ctype's virtual destructor protected?
I was trying to write
std::ctype<char> c;
but I couldn't, because that class's is both protected (directly) and virtual (indirectly, through facet).
But I can do this just fine:
struct : std::ctype<char> { } c;
This made me wonder, what's the point of making std::ctype's destructor protected?
For example, is it trying to prevent a misuse or mistake? If so, what is that?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
