🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.objects
1 messages
1 total messages Started by Miroslaw.Makowiecki Wed, 28 Mar 2007 14:41
Optymalizacja superklas
#16013
Author: Miroslaw.Makowiecki
Date: Wed, 28 Mar 2007 14:41
19 lines
1748 bytes
Mamy oto klasę numer 1;
class klasa1:public ifstream
{
 void open(char const*path){
   static_cast<ifstream*>(this>->open(path);
  }
};
klasę numer 2
class klasa2:public klasa2
{
  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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads