Re: operator inheritance problem
From: John Carson (donaldquixote_at_datafast.net.au)
Date: 10/19/03
- Next message: Asfand Yar Qazi: "Critique requested for a smart pointer implementation"
- Previous message: Andrew Koenig: "Re: Performance or other differences on if expression?"
- In reply to: Juha Tenhosaari: "Vs: operator inheritance problem"
- Next in thread: Tim Threlfall: "Re: operator inheritance problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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)
- Next message: Asfand Yar Qazi: "Critique requested for a smart pointer implementation"
- Previous message: Andrew Koenig: "Re: Performance or other differences on if expression?"
- In reply to: Juha Tenhosaari: "Vs: operator inheritance problem"
- Next in thread: Tim Threlfall: "Re: operator inheritance problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|