RE: [ROOT] problem with overloaded methods in ACLIC

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Jul 23 2002 - 20:03:13 MEST


Hi Ruben,

The differences in the warning messages is probably only due to the
different flags being used (for example with or without -Wall).

Jacek is correct.  The C++ standard does mandate for ALL signatures of a
method to be overloaded at the same time.  It also provides with a shortcut
(but not all compiler implements this shortcut).  You can use the syntax:

	using NaElem::CreatGeometry;

For more details see paragraphe 7.3.3 of the C++ standard.

Cheers,
Philippe


-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ruben Shahoian
Sent: Tuesday, July 23, 2002 12:34 PM
To: Jacek M. Holeczek
Cc: roottalk@cern.ch
Subject: Re: [ROOT] problem with overloaded methods in ACLIC


Hi Jacek,
thanks, but I think I implemented all overloaded methods: in the example
I gave, base class (NaElem) has 2 (virtual) methods
CreateGeometry(NaElem*) and CreateGeometry(void), they are both
implemented.
The deriving class (NaDetector) implements its own version of
CreateGeometry(void) and inherits from its base class
CreateGeometry(NaElem*). So, I think, there is no C++ standards violation.
Also, the g++ does complain at all, it is only ACLIC which produces these
warnings.

Best regrads,
	Ruben

On Tue, 23 Jul 2002, Jacek M. Holeczek wrote:

> Hi,
> I think that what you see originates in the following problem.
> If you overloaded a method with a particular "name" and particular
> "signature" (I mean set of parameters), you have to write the code for ALL
> possible "signatures" of this method (if I remember well, this is written
> in the C++ standard - maybe Philippe could comment more on this).
> In your example that means that you overload "CreateGeometry(some set of
> parameters)", but you did not overload "CreateGeometry (NaElem *)" and
> "CreateGeometry ()". And that is why you get the warning from the
> compiler.
> Best regards,
> Jacek.
>
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:00 MET