Hatalar, hatalar, sorular - sayfa 1434

 

Derleme hatası: '<' - şablon uyuşmazlığı

 template < typename T>
class A {
        T t;
};
class B {
                        B() : a( new A< int > ) {} //Error: <' - template mismatch
        A< int > * const a;
};
 
A100 :

Derleme hatası: '<' - şablon uyuşmazlığı

Teşekkürler, anladık.
 

Bildiri içinde yapıcı ve yıkıcı için tam ad belirtemezsiniz, yöntemler için yapabilirsiniz (ve neden öncekiler daha kötü?)

 class A {
         void A::f() {}     //нормально
               A::A() {}   //Error: '::' - name expected
         virtual A::~A() {} //Error: '::' - name expected
};
Bu neden gerekli? - beyanı ve uygulamayı şablonlarda ayırmanın tek yolunun bu olduğu ortaya çıktı.
 

Sipariş kapatma penceresiyle bir şeyler yapın.
Sipariş numaraları tam olarak görünmüyor. Bir sütunun genişliğini değiştirirken sabitlenmez ve geriye doğru büzülür. Ve pencerenin kendisi uzatılamaz.


 

SetLevelValue() işleviyle beşinci basamağın değeri görüntülenemiyor

 //+------------------------------------------------------------------+
//|                                               Ind_TickTest01.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 2
//-----
double    Buffer0[];
double    Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
   IndicatorSetInteger ( INDICATOR_DIGITS , 8 );
   SetIndexBuffer ( 0 ,Buffer0);
   SetIndexBuffer ( 1 ,Buffer1);
//-----
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[])
  {
   IndicatorShortName( "Ind Bid NO 5-ZNAK!!! >>" + DoubleToString (Bid, _Digits ));
   Buffer0[ 0 ]=Bid- 0.00015 ;
   Buffer1[ 0 ]=Bid+ 0.00015 ;
   SetLevelValue( 0 ,Bid- 0.0001 );
   SetLevelValue( 1 ,Bid- 0.00005 );
   SetLevelValue( 2 ,Bid);
   SetLevelValue( 3 ,Bid+ 0.00005 );
   SetLevelValue( 4 ,Bid+ 0.0001 );
   return (rates_total);
  }
//+------------------------------------------------------------------+

Sonuç:

NO5-Znak

 
Gösterge Rakamları. Şimdi buna ne denir. Sanırım şimdi biri söyleyecek
 
Комбинатор :
Gösterge Rakamları. Şimdi buna ne denir. Sanırım şimdi biri söyleyecek

Muhtemelen ;)

 IndicatorSetInteger ( INDICATOR_DIGITS , Digits ());
 
Artyom Trishkin :

Muhtemelen ;)

Denedim - yardımcı olmuyor.

Beşinci işaret yok

 //+------------------------------------------------------------------+
//|                                               Ind_TickTest01.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 2
//----- indicator_levelN
double    Buffer0[];
double    Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
   IndicatorSetInteger ( INDICATOR_DIGITS , 5 );
   SetIndexBuffer ( 0 ,Buffer0);
   SetIndexBuffer ( 1 ,Buffer1);
//-----
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[])
  {
   IndicatorShortName( "Ind Bid NO 5-ZNAK!!! >>" + DoubleToString (Bid, _Digits ));
   Buffer0[ 0 ]=Bid- 0.00015 ;
   Buffer1[ 0 ]=Bid+ 0.00015 ;
   SetLevelValue( 0 ,Bid- 0.0001 );
   SetLevelValue( 1 ,Bid- 0.000075 );
   SetLevelValue( 2 ,Bid- 0.00005 );
   SetLevelValue( 3 ,Bid- 0.000025 );
   SetLevelValue( 4 ,Bid);
   SetLevelValue( 5 ,Bid+ 0.000025 );
   SetLevelValue( 6 ,Bid+ 0.00005 );
   SetLevelValue( 7 ,Bid+ 0.000075 );
   SetLevelValue( 8 ,Bid+ 0.0001 );
   return (rates_total);
  }
//+------------------------------------------------------------------+
 
Yury Kirillov :

Denedim - yardımcı olmuyor.

SD yanıtı:

Destek Ekibi 2015.11.20 14:33

Dört seviyede 4 basamaklı bir doğrulukla görüntülenir.

Daha önce, kimse buna dikkat etmedi. Bu nedenle şimdiye kadar bu yere dokunulmamıştır.

Göstergenin Rakam doğruluğu ile çıktısını yapalım

 

Derleme Hatası

 struct A {
         int a1;
         int a2;
};
struct B {
         static A a;
         static int b1;
         static int b2;
         static int b3;
};
A B::a = { 2 , 3 };
int B::b1 = 1 ;
int B::b2 = B::b1;   //нормально
int B::b3 = B::a.a2; //'a2' - non-static members and methods cannot be used
B::a'nın statik olması yeterlidir