I’m trying to do the following:
class Animal
{
class Bear : public Animal
{
// …
};
class Giraffe : public Animal
{
// …
};
};
… but my compiler appears to choke on this. Is this legal C++, and if not, is there a better way to accomplish the same thing? Essentially, I want to create a cleaner class naming scheme. (I don’t want to derive Animal
and the inner classes from a common base class)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…