🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309682

Re: Dziedziczcenie i metody

#309682
From: Piotr Gałka
Date: Thu, 07 Jun 2018 10:06
26 lines
1800 bytes
W dniu 2018-06-07 o 11:02, radoslaw@korzeniewski.net pisze:
> Witam,
> 
> Mam klasę bazową A:
> class A {
>    bool send() { return send(0); };
>    virtual bool send(int flags);
> }
> oraz klasę pochodną B:
> class B: public A {
>    bool send(int flags);
> }
> chciałbym teraz móc skorzystać z B.send() ale kompilator wywala:
> error: no matching function for call to ‘B::send()’
>    b.send();
>               ^
> note: candidate: virtual bool B::send(int)
> obejście w postaci zdefiniowania B::send() jakoś mi nie pasuje. Przyjmę wszelaką krytykę i pomoc, także query do google.
> 

Nie jestem biegłym programistą (raz na rok jakiś mały programik 
narzędziowy mi się zdarzy).

Moim pierwszym skojarzeniem jest, że send() jest prywatną funkcją A. 
Można ją wywołać tylko w funkcjach klasy A.
P.G.
Technical Details
Message-ID: <pfb02j$94m$1$PiotrGalka@news.chmurka.net>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.213.192.88.238!not-for-mail
References: <342f89bb-b3d4-4c87-9dd7-97a572d63ab0@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.213.192.88.238!not-for-mail
From: Piotr Gałka <piotr.galka@cutthismicromade.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: Dziedziczcenie i metody
Date: Thu, 7 Jun 2018 12:06:15 +0200
Organization: news.chmurka.net
Message-ID: <pfb02j$94m$1$PiotrGalka@news.chmurka.net>
References: <342f89bb-b3d4-4c87-9dd7-97a572d63ab0@googlegroups.com>
NNTP-Posting-Host: 213.192.88.238
Mime-Version: 1.0
Injection-Date: Thu, 7 Jun 2018 10:06:11 +0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="PiotrGalka"; posting-host="213.192.88.238"; logging-data="9366"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
In-Reply-To: <342f89bb-b3d4-4c87-9dd7-97a572d63ab0@googlegroups.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit