Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-06-12 23:02:12


On Wednesday 12 June 2002 04:28 pm, Fernando Cacciola wrote:
> AFAIK, a using-declaration is useful only when resolving 'conflicting'
> signatures.
> Unless I'm too sleepy already, if 'check' is not a virtual function, its
> complete signature (argument types including) is what matters here.
> In this case, since it is assumed that all the types in the list are
> different, each checker sub-class would have its own version of check()
> with a different signature than any other check() on the hierarchy. There
> shouldn't be any name-hiding to resolve.

Reread 10.2/2, especially this sentence:
  "A member name f in one sub-object B hides a member name f in a sub-object A
if A is a base class sub-object of B."

Go ahead and look at the output of Brad's sample code with and without the
using directive. With the using directive on GCC 3.1, one gets:

check(i)
check(c)

Without the using directive, the 'int' version hides the 'char' version, an an
implicit conversion from char to int is used and we get:

check(i)
check(i)

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk