"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:c1**********@chessie.cirr.com...
Why can't I use a class destructor in a using declaration:
using MyClass::~MyClass;
================================================== ==================
ISO/IEC 14882:1998(E)
7.3.3 The using declaration
4 A using*-declaration used as a member*-declaration shall refer
to a member of a base class of the class being defined, shall
refer to a member of an anonymous union that is a member of a
base class of the class being defined, or shall refer to an
enumerator for an enumeration type that is a member of a base
class of the class being defined. [Example:
class C {
int g();
};
class D2 : public B {
using B::f; // OK: B is a base of D2
using B::e; // OK: e is an enumerator of base B
using B::x; // OK: x is a union member of base B
using C::g; // error: C isn’t a base of D2
};
--end example] [Note: since constructors and destructors do not
have names, a using*-declaration cannot refer to a constructor <<=====
or a destructor for a base class. Since specializations of member
templates for conversion functions are not found by name lookup,
they are not considered when a using*-declaration specifies a
conversion function (14.5.2). ] If an assignment operator brought
from a base class into a derived class scope has the signature of
a copy*-assignment operator for the derived class (12.8), the using*-
declaration does not by itself suppress the implicit declaration
of the derived class copy*-assignment operator; the copy*-assignment
operator from the base class is hidden or overridden by the
implicitly*-declared copy*-assignment operator of the derived class,
as described below.
================================================== ==================
-Mike