これらのクラスがあるとします:
class Base
{
public:
class Foo { ... };
...
};
次に、別のクラスがベースから派生します。
class Derived : public Base
{
// no mention or redefinition of nested class "Foo" anywhere in "Derived"
};
これは、 が別個のものになったということですかDerived::Foo
、それとも とDerived::Foo
まったく同じBase::Foo
ですか?
このシナリオにはひねりがありますDerived::Foo
。このシナリオでキャッチされるでしょうか:
catch ( const Base::Foo &ex )
{
// would this also catch an instance of Derived::Foo?
}