Re: operator inheritance problem

From: John Carson (donaldquixote_at_datafast.net.au)
Date: 10/19/03


Date: Mon, 20 Oct 2003 00:13:33 +1000


"Juha Tenhosaari" <juha.news@telia.com> wrote in message
news:qWukb.33797$dP1.106935@newsc.telia.net
>
> Thanks for the answers.
>
> I modified the derived class this way:
>
> class B : public A
> {
> using A::operator=;
> public:
> int b;
> }
>
>
> ...but my compiler gave me error message "Identifier expected". I
> wonder why.

You don't say the line at which this error message occurs. I believe that by
putting the using declaration at the start of the class, you have implicitly
made the operator private. Try moving it after public:
Note that compiler implementation of using declarations are very buggy, so I
would not be surprised if it didn't work.

After moving the using declaration to after public:, the code compiles find
using Dinkum Exam.

http://www.dinkumware.com/exam/dinkumExam.aspx

-- 
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)


Relevant Pages

  • Re: Compiler Warning C4373 about virtual methods
    ... Top-level const qualifiers are ignored in a function declaration. ... derived class: instead of the latter overriding the former, ... where it used to call base class version). ...
    (microsoft.public.vc.language)
  • Re: Compiler Warning C4373 about virtual methods
    ... Top-level const qualifiers are ignored in a function declaration. ... derived class: instead of the latter overriding the former, ...
    (microsoft.public.vc.language)
  • Re: polymorph object - why doesnt it work???
    ... Look at this declaration of display, ... You will see that the virtual function in the base class is a const one, ... but the function declared in the derived class is not. ...
    (comp.lang.cpp)
  • Re: [PATCH 1/3] [net/core] move dev_mc_discard from dev_mcast.c to dev.c
    ... On 7/18/07, David Miller wrote: ... > this moving could make this non-global function static, ... > and also remove its declaration in netdevice.h; ... I don't think the single file dev_mcast.c is needed anymore. ...
    (Linux-Kernel)
  • Re: VC++ standard compliance - code
    ... derived class if I add a using declaration in the public section of the ... > object parameter that makes the declarations overloadable. ... >> int NumberOfArguments, ...
    (microsoft.public.vc.language)