🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.objects
Article #16015

Optymalizacja superklas

#16015
From: Miroslaw.Makowiecki
Date: Wed, 28 Mar 2007 14:57
22 lines
1765 bytes
Mamy oto klasę numer 1
 class klasa1:public std::ifstream
 {
  void open(char const*path){
    static_cast<std::ifstream*>(this)->open(path);
   }

};
klasę numer 2
 class klasa2:public klasa1
 {
   void open(char const*path){
       static_cast<klasa1*>(this)->open(path);

}

Jak widzimy klasy klasa1 i klasa2 robią dokładnie to samo,jak
 zauważyłem z mojego doświadczenia klasa klasa2 działa wolniej niż
 klasa klasa1.
 Pytanie: Czy istnieje jakaś opcja optymalizacji oprogramowania w
 kompilatorze g++-4.2 języka c++ która powoduje że szybkość działania
 klas klasa1 i klasa2 są jednakowe?
Technical Details
Message-ID: <1175093835.067046.322390@n59g2000hsh.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!n59g2000hsh.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!n59g2000hsh.googlegroups.com!not-for-mail
From: Miroslaw.Makowiecki@gmail.com
Newsgroups: pl.comp.objects
Subject: Optymalizacja superklas
Date: 28 Mar 2007 07:57:15 -0700
Organization: http://groups.google.com
Lines: 25
Message-ID: <1175093835.067046.322390@n59g2000hsh.googlegroups.com>
NNTP-Posting-Host: 83.18.174.178
Mime-Version: 1.0
X-Trace: posting.google.com 1175093836 18833 127.0.0.1 (28 Mar 2007 14:57:16 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 28 Mar 2007 14:57:16 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.18-1-686; X11; i686; pl) KHTML/3.5.5 (like Gecko) (Debian package 4:3.5.5a.dfsg.1-6),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 HAVP, 1.0 zwolen:8080 (squid/2.5.STABLE9)
Complaints-To: groups-abuse@google.com
Injection-Info: n59g2000hsh.googlegroups.com; posting-host=83.18.174.178;   posting-account=ZtCzpw0AAAB7bcDRjtJwIIcbCszsYq0O
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit