Re: [Libxmlplusplus-general] coding style issues



On Fri, Jan 31, 2003 at 11:13:34AM -0500, Stefan Seefeld wrote:

> 1) I suggest to use 'using namespace xmlpp;' inside .cc files,

IMHO this is a Good Thing.

> 2) 'using foomethod;' in derived class declaration:
>    Murray suggests people may not be familiar with that concept.
>    The goal of this shortcut is to drag base class methods into the
>    derived class. A more lengthy way would be to write
>    'foomethod() { BaseClass::foomethod();}
>
>    That's relevant in two situations:
>    a) the base method declares the method in question as being
>       protected, while the derived class wants to expose it publicly.
>    b) the derived class overrides the method by a method with the same
>       name, but a different signature. Example:

(N.B. this is an overload, not an override)

>       the base class has 'void foo();', and the derived class defines
>       'void foo(int);'. This would hide the original 'void foo();'
>       method, so if you want to expose both, you have to redeclare (via
>       'using') or redefine it.

FYI:
GCC 2.95 doesn't support using declarations at class scope if the name
is subsequently overloaded, so hidden functions must be redefined.
RedHat's GCC 2.96 does support such using decls, but FreeBSD's 2.95.4
doesn't, and AFAIK Debian's 2.95.4 doesn't either.
Should libxml++ work with GCC 2.95 ?

jon


-- 
"Always Read the Label"
	- anon.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]