Errori, bug, domande - pagina 2011

 
Ho capito bene che tali array non possono essere inizializzati in modo ragionevole?
class A {};

A* const Array[] = {NULL};

E hanno senso solo come parametri di input per funzioni/metodi?

void f( const A* const &Array[] );
 

MT4 build 1090

void OnStart()
{
   ResetLastError();
   ObjectCreate(ChartID(),"SomeName",OBJ_ARROW,0,0,0);
   ObjectCreate(ChartID(),"SomeName",OBJ_ARROW,0,0,0);
   Print("Ошибка повторного создания объекта на ТЕКУЩЕМ чарте Error=",GetLastError());
   ObjectDelete(ChartID(),"SomeName");

   ResetLastError();
   ObjectCreate(ChartFirst(),"SomeName",OBJ_ARROW,0,0,0);
   ObjectCreate(ChartFirst(),"SomeName",OBJ_ARROW,0,0,0);
   Print("Ошибка повторного создания объекта на ПЕРВОМ чарте Error=",GetLastError());
   ObjectDelete(ChartFirst(),"SomeName");

   ResetLastError();
   ObjectCreate(ChartNext(ChartFirst()),"SomeName",OBJ_ARROW,0,0,0);
   ObjectCreate(ChartNext(ChartFirst()),"SomeName",OBJ_ARROW,0,0,0);
   Print("Ошибка повторного создания объекта на НЕ ТЕКУЩЕМ чарте Error=",GetLastError());
   ObjectDelete(ChartNext(ChartFirst()),"SomeName");

   ResetLastError();
   ObjectCreate(0,"SomeName",OBJ_ARROW,0,0,0);
   ObjectCreate(0,"SomeName",OBJ_ARROW,0,0,0);
   Print("Ошибка повторного создания объекта на ТЕКУЩЕМ чарте Error=",GetLastError());
   ObjectDelete(0,"SomeName");
   
   ResetLastError();

   Print("__MQL4BUILD__ = ",__MQL4BUILD__," TERMINAL_BUILD = ",TERMINAL_BUILD);
}

Errore nel ricreare l' oggetto sulgrafico CURRENT Error=4200


Errore nel ricreare un oggetto su un grafico non corrente Error=0

Bug?
 

Controllare lo script:

Esegue tutti i grafici nel terminale, crea un oggetto con un nome ripetuto e genera un errore nel log.

Controllerà anche la velocità di ricerca dell'oggetto creato sul grafico.

void OnStart()
  {

   Print("__MQL4BUILD__ = ",__MQL4BUILD__," TERMINAL_BUILD = ",TERMINAL_BUILD);

   ResetLastError();
//--- переменные для идентификаторов графиков 
   long currChart,prevChart=ChartFirst();
   int i=0,limit=100;
   Print("ChartFirst = ",ChartSymbol(prevChart)," ID = ",prevChart);
//создадим дублирующий объект для графика и выведем ошибку
   ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
   ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
   Print(" Error on creating duplicate object - GetLastError=",GetLastError());
   ObjectDelete(prevChart,"SomeName");
   ObjectFindSearchBench(1000,prevChart);//SearchBench
   while(i<limit)// у нас наверняка не больше 100 открытых графиков 
     {

      currChart=ChartNext(prevChart); // на основании предыдущего получим новый график 
      if(currChart<0) break;          // достигли конца списка графиков 
      Print(i," ",ChartSymbol(currChart)," ID =",currChart);
      prevChart=currChart;// запомним идентификатор текущего графика для ChartNext() 
                          //создадим дублирующиеся объекты
      ResetLastError();
      ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
      ObjectCreate(prevChart,"SomeName",OBJ_ARROW,0,0,0);
      Print(" Error on creating duplicate object - GetLastError=",GetLastError());
      ObjectDelete(prevChart,"SomeName");
      ObjectFindSearchBench(1000,prevChart);//SearchBench
      i++;// не забудем увеличить счетчик 
     }


  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
ulong ObjectFindSearchBench(const int Amount=1 e3,long chart=0)
  {
   int b=0,f=0;
   
   ResetLastError();
   if(chart==0) chart=ChartID();
   const ulong StartTime=GetMicrosecondCount();
//создадим объект и потом найдем его Amount раз
   ObjectCreate(chart,"SomeName",OBJ_ARROW,0,0,0);

   for(int w=0;w<Amount;w++)
     {
      if(ObjectFind(chart,"SomeName")>=0)
        {
         b++;
        }
      else f++;
     }
   Print("Time to search Object by name ",Amount," times is ",GetMicrosecondCount()-StartTime," microseconds. ChartID=",chart," found obj: ",b," not found obj: ",f,chart==ChartID()?" CURRENT CHART":"");
   return(GetMicrosecondCount() - StartTime);
  }

Vedi se puoi eseguire lo script, per favore.

Il mio diario:

0 19:51:01.427 test CHFJPY.e,H1: __MQL4BUILD__ = 553 TERMINAL_BUILD = 5

0 19:51:01.427 test CHFJPY.e,H1: ChartFirst = EURCAD.e ID = 131498872250507535

0 19:51:01.427 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.443 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 15129 microsecondi. ChartID=131498872250507535 trovato obj: 1000 non trovato obj: 0

0 19:51:01.443 test CHFJPY.e,H1: 0 EURCAD.e ID=131500664876581320

0 19:51:01.443 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.463 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 20278 microsecondi. ChartID=131500664876581320 trovato obj: 1000 non trovato obj: 0

0 19:51:01.463 test CHFJPY.e,H1: 1 CADJPY.e ID=131502896347051608

0 19:51:01.463 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.479 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 15825 microsecondi. ChartID=131502896347051608 trovato obj: 1000 non trovato obj: 0

0 19:51:01.479 test CHFJPY.e,H1: 2 EURCAD.e ID=131502897682567227

0 19:51:01.479 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.529 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 50372 microsecondi. ChartID=131502897682567227 trovato obj: 1000 non trovato obj: 0

0 19:51:01.529 test CHFJPY.e,H1: 3 GBPJPY.e ID=131505457001351910

0 19:51:01.529 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.541 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 11587 microsecondi. ChartID=131505457001351910 trovato obj: 1000 non trovato obj: 0

0 19:51:01.541 test CHFJPY.e,H1: 4 GBPCHF.e ID=131505572251554422

0 19:51:01.541 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.554 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 13026 microsecondi. ChartID=131505572251554422 trovato obj: 1000 non trovato obj: 0

0 19:51:01.554 test CHFJPY.e,H1: 5 AUDCHF.e ID=131505732457965009

0 19:51:01.554 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.567 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 12949 microsecondi. ChartID=131505732457965009 trovato obj: 1000 non trovato obj: 0

0 19:51:01.567 test CHFJPY.e,H1: 6 USDCHF.e ID=131506110968531490

0 19:51:01.567 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.587 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 20701 microsecondi. ChartID=131506110968531490 trovato obj: 1000 non trovato obj: 0

0 19:51:01.587 test CHFJPY.e,H1: 7 AUDUSD.e ID=131507551330304303

0 19:51:01.587 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.606 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 18558 microsecondi. ChartID=131507551330304303 trovato obj: 1000 non trovato obj: 0

0 19:51:01.606 test CHFJPY.e,H1: 8 EURCAD.e ID=131507869928472695

0 19:51:01.606 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.619 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 13219 microsecondi. ChartID=131507869928472695 trovato obj: 1000 non trovato obj: 0

0 19:51:01.619 test CHFJPY.e,H1: 9 EURAUD.e ID=131507916092399918

0 19:51:01.619 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=0

0 19:51:01.632 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è 12294 microsecondi. ChartID=131507916092399918 trovato obj: 1000 non trovato obj: 0

0 19:51:01.632 test CHFJPY.e,H1: 10 CHFJPY.e ID=131508222052591588

0 19:51:01.632 test CHFJPY.e,H1: Errore nella creazione di un oggetto duplicato - GetLastError=4200

0 19:51:01.632 test CHFJPY.e,H1: Il tempo per cercare l'oggetto per nome 1000 volte è di 98 microsecondi. ChartID=131508222052591588 trovato obj: 1000 non trovato obj: 0 CURRENT CHART


La mia velocità di ricerca differisce di 100-500 volte...

E tu?

 
Kirill Belousov:

Controllare lo script:

Esegue tutti i grafici nel terminale, crea un oggetto con un nome ripetuto e registra un errore.

Controllerà anche la velocità di ricerca dell'oggetto creato sul grafico.

Vedi se puoi eseguire lo script, per favore.


La mia velocità di ricerca varia di un fattore di 100-500...

E tu?


0       19:59:35.973    PeriodConverter GBPUSDf,M15: __MQL4BUILD__ = 553 TERMINAL_BUILD = 5
0       19:59:35.973    PeriodConverter GBPUSDf,M15: ChartFirst = AUDUSDf ID = 130936784496551158
0       19:59:35.973    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.013    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 32430 microseconds. ChartID=130936784496551158 found obj: 1000 not found obj: 0
0       19:59:36.013    PeriodConverter GBPUSDf,M15: 0 USDCADf ID =130936784496551160
0       19:59:36.013    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.023    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 11738 microseconds. ChartID=130936784496551160 found obj: 1000 not found obj: 0
0       19:59:36.023    PeriodConverter GBPUSDf,M15: 1 GBPAUDf ID =130936784496551163
0       19:59:36.023    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.033    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 7645 microseconds. ChartID=130936784496551163 found obj: 1000 not found obj: 0
0       19:59:36.033    PeriodConverter GBPUSDf,M15: 2 EURUSDf ID =130936784496551164
0       19:59:36.033    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.043    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 8734 microseconds. ChartID=130936784496551164 found obj: 1000 not found obj: 0
0       19:59:36.043    PeriodConverter GBPUSDf,M15: 3 EURJPYf ID =130936784496551165
0       19:59:36.043    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.053    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 12249 microseconds. ChartID=130936784496551165 found obj: 1000 not found obj: 0
0       19:59:36.053    PeriodConverter GBPUSDf,M15: 4 EURCADf ID =130936784496551166
0       19:59:36.053    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.063    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 15107 microseconds. ChartID=130936784496551166 found obj: 1000 not found obj: 0
0       19:59:36.063    PeriodConverter GBPUSDf,M15: 5 USDCHFf ID =130936784496551167
0       19:59:36.063    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.093    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 31361 microseconds. ChartID=130936784496551167 found obj: 1000 not found obj: 0
0       19:59:36.093    PeriodConverter GBPUSDf,M15: 6 GBPUSDf ID =130936784496551169
0       19:59:36.093    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=4200
0       19:59:36.093    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 156 microseconds. ChartID=130936784496551169 found obj: 1000 not found obj: 0 CURRENT CHART
0       19:59:36.093    PeriodConverter GBPUSDf,M15: 7 AUDCADf ID =130936784496551170
0       19:59:36.093    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.103    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 10455 microseconds. ChartID=130936784496551170 found obj: 1000 not found obj: 0
0       19:59:36.103    PeriodConverter GBPUSDf,M15: 8 CADCHFf ID =130936784496551171
0       19:59:36.103    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.133    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 28968 microseconds. ChartID=130936784496551171 found obj: 1000 not found obj: 0
0       19:59:36.133    PeriodConverter GBPUSDf,M15: 9 NZDCADf ID =130936784496551175
0       19:59:36.133    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.153    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 18735 microseconds. ChartID=130936784496551175 found obj: 1000 not found obj: 0
0       19:59:36.153    PeriodConverter GBPUSDf,M15: 10 NZDCHFf ID =130936784496551176
0       19:59:36.153    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.163    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 10593 microseconds. ChartID=130936784496551176 found obj: 1000 not found obj: 0
0       19:59:36.163    PeriodConverter GBPUSDf,M15: 11 NZDUSDf ID =130936784496551178
0       19:59:36.163    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.193    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 23403 microseconds. ChartID=130936784496551178 found obj: 1000 not found obj: 0
0       19:59:36.193    PeriodConverter GBPUSDf,M15: 12 EURNZDf ID =130936912624549660
0       19:59:36.193    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.213    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 19404 microseconds. ChartID=130936912624549660 found obj: 1000 not found obj: 0
0       19:59:36.213    PeriodConverter GBPUSDf,M15: 13 EURAUDf ID =130936912624549662
0       19:59:36.213    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       19:59:36.213    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 7570 microseconds. ChartID=130936912624549662 found obj: 1000 not found obj: 0
0       19:59:36.213    PeriodConverter GBPUSDf,M15: uninit reason 0
0       19:59:36.223    Script PeriodConverter GBPUSDf,M15: removed


0       20:00:18.966    Script PeriodConverter GBPUSDf,M15: loaded successfully
0       20:00:18.986    PeriodConverter GBPUSDf,M15: initialized
0       20:00:18.986    PeriodConverter GBPUSDf,M15: __MQL4BUILD__ = 553 TERMINAL_BUILD = 5
0       20:00:18.986    PeriodConverter GBPUSDf,M15: ChartFirst = AUDUSDf ID = 130936784496551158
0       20:00:18.986    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.036    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 42453 microseconds. ChartID=130936784496551158 found obj: 1000 not found obj: 0
0       20:00:19.036    PeriodConverter GBPUSDf,M15: 0 USDCADf ID =130936784496551160
0       20:00:19.036    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.046    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 17436 microseconds. ChartID=130936784496551160 found obj: 1000 not found obj: 0
0       20:00:19.046    PeriodConverter GBPUSDf,M15: 1 GBPAUDf ID =130936784496551163
0       20:00:19.046    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.086    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 33961 microseconds. ChartID=130936784496551163 found obj: 1000 not found obj: 0
0       20:00:19.086    PeriodConverter GBPUSDf,M15: 2 EURUSDf ID =130936784496551164
0       20:00:19.086    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.096    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 8201 microseconds. ChartID=130936784496551164 found obj: 1000 not found obj: 0
0       20:00:19.096    PeriodConverter GBPUSDf,M15: 3 EURJPYf ID =130936784496551165
0       20:00:19.096    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.106    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 13671 microseconds. ChartID=130936784496551165 found obj: 1000 not found obj: 0
0       20:00:19.106    PeriodConverter GBPUSDf,M15: 4 EURCADf ID =130936784496551166
0       20:00:19.106    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.136    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 28041 microseconds. ChartID=130936784496551166 found obj: 1000 not found obj: 0
0       20:00:19.136    PeriodConverter GBPUSDf,M15: 5 USDCHFf ID =130936784496551167
0       20:00:19.136    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.146    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 12396 microseconds. ChartID=130936784496551167 found obj: 1000 not found obj: 0
0       20:00:19.146    PeriodConverter GBPUSDf,M15: 6 GBPUSDf ID =130936784496551169
0       20:00:19.146    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=4200
0       20:00:19.146    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 159 microseconds. ChartID=130936784496551169 found obj: 1000 not found obj: 0 CURRENT CHART
0       20:00:19.146    PeriodConverter GBPUSDf,M15: 7 AUDCADf ID =130936784496551170
0       20:00:19.146    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.236    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 91767 microseconds. ChartID=130936784496551170 found obj: 1000 not found obj: 0
0       20:00:19.236    PeriodConverter GBPUSDf,M15: 8 CADCHFf ID =130936784496551171
0       20:00:19.236    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.296    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 53496 microseconds. ChartID=130936784496551171 found obj: 1000 not found obj: 0
0       20:00:19.296    PeriodConverter GBPUSDf,M15: 9 NZDCADf ID =130936784496551175
0       20:00:19.296    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.378    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 80612 microseconds. ChartID=130936784496551175 found obj: 1000 not found obj: 0
0       20:00:19.378    PeriodConverter GBPUSDf,M15: 10 NZDCHFf ID =130936784496551176
0       20:00:19.378    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.418    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 42953 microseconds. ChartID=130936784496551176 found obj: 1000 not found obj: 0
0       20:00:19.418    PeriodConverter GBPUSDf,M15: 11 NZDUSDf ID =130936784496551178
0       20:00:19.418    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.438    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 19186 microseconds. ChartID=130936784496551178 found obj: 1000 not found obj: 0
0       20:00:19.438    PeriodConverter GBPUSDf,M15: 12 EURNZDf ID =130936912624549660
0       20:00:19.438    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.448    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 9539 microseconds. ChartID=130936912624549660 found obj: 1000 not found obj: 0
0       20:00:19.448    PeriodConverter GBPUSDf,M15: 13 EURAUDf ID =130936912624549662
0       20:00:19.448    PeriodConverter GBPUSDf,M15:  Error on creating duplicate object - GetLastError=0
0       20:00:19.498    PeriodConverter GBPUSDf,M15: Time to search Object by name 1000 times is 47959 microseconds. ChartID=130936912624549662 found obj: 1000 not found obj: 0
 
Vitaly Muzichenko:

Senka prende la palla

Sembra LUI :)

 
Kirill Belousov:

Senka prende la palla

Sembra LUI :)

Non ho capito niente, ma è comunque divertente.

 
Vitaly Muzichenko:

Non ho capito niente, ma è comunque divertente.

Bug.

Nessun errore 4200 quando si crea un oggetto duplicato su un grafico non corrente (che dà su quello corrente - [vedere "CURRENT CHART" nel log]),

così come ha scoperto che trovare un oggetto nel GRAFICO RECENTE richiede fino a 500 volte più tempo che trovare quello attuale.

а :) perché si scopre che non sono l'unico

 
fxsaber:
Ho capito bene che tali array non possono essere inizializzati in modo sensato?

E hanno senso solo come parametri di input per funzioni/metodi?

class A {
public:
        void f() {}
};
A* const a[10] = { NULL };
void OnStart()
{
        A *aa = new A;
         ((A *)a[ 9 ]) = aa; //нет ошибки при компиляции
               a[ 9 ].f();   //нет ошибки при выполнении
        Print( a[ 9 ] == aa ); //Результат: false
}

Si potrebbe pensare che sia possibile, ma come si può vedere dall'esempio - porta a errori difficili da catturare

 
A100:
((A *)a[ 9 ]) = aa; //нет ошибки при компиляции

Sì, c'è un bug del compilatore qui, ma nessuna esecuzione va oltre questo punto - puntatore non valido.

Quindi, di fatto, l'inizializzazione non è possibile.

 
fxsaber:

Sì, c'è un bug del compilatore qui, ma l'esecuzione non va oltre questo posto - puntatore non valido.

Allora il bug è anche nel fatto che per le versioni a 32 bit (io ho esattamente tale) l'esecuzione è senza errori. puntatore non valido - solo se si aumenta la classe con un membro, ad esempio int i