POV-Ray : Newsgroups : povray.off-topic : A question about Java generics (not a flame) : Re: A question about Java generics (not a flame) Server Time
7 Sep 2024 21:14:50 EDT (-0400)
  Re: A question about Java generics (not a flame)  
From: Fredrik Eriksson
Date: 14 May 2008 17:01:28
Message: <op.ua5woqdy7bxctx@e6600>
On Wed, 14 May 2008 22:52:33 +0200, Darren New <dne### [at] sanrrcom> wrote:
> Fredrik Eriksson wrote:
>> On Wed, 14 May 2008 18:23:54 +0200, Darren New <dne### [at] sanrrcom> wrote:
>>>
>>> *** Main2.cpp
>>>
>>> #include <A.h>
>>>
>>> void A::xx(int i) {
>>>    cout << "Beta!\n";
>>> }
>>  This will fail to compile, because you cannot redefine A::xx.
>
> I didn't. I created an overloaded version. One takes an int, the other  
> takes a long.  Am I *completely* clueless about C++?

You cannot add overloads to class methods from outside the class. All  
overloads must be declared in the class declaration.


-- 
FE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.