오류, 버그, 질문 - 페이지 1434

 

컴파일 오류: '<' - 템플릿 불일치

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

컴파일 오류: '<' - 템플릿 불일치

감사합니다. 이해합니다.
 

선언 내에서 생성자와 소멸자의 전체 이름을 지정할 수 없지만 메서드의 경우 지정할 수 있습니다(전자가 더 나쁜 이유는 무엇입니까?)

 class A {
         void A::f() {}     //нормально
               A::A() {}   //Error: '::' - name expected
         virtual A::~A() {} //Error: '::' - name expected
};
이것이 왜 필요한가? - 이것이 템플릿에서 선언과 구현을 분리하는 유일한 방법임이 밝혀졌습니다.
 

주문 마감 창에서 작업을 수행하십시오.
주문 번호가 완전히 보이지 않습니다. 열의 너비를 변경할 때 고정되지 않고 뒤로 축소됩니다. 그리고 창 자체는 늘릴 수 없습니다.


 

SetLevelValue() 함수를 사용하여 다섯 번째 숫자의 값을 표시할 수 없습니다.

 //+------------------------------------------------------------------+
//|                                               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);
  }
//+------------------------------------------------------------------+

결과:

NO5-Znak

 
표시 자릿수. 이제 이름이 무엇입니까? 이제 누군가가 말할 것 같아요
 
Комбинатор :
표시 자릿수. 이제 이름이 무엇입니까? 이제 누군가가 말할 것 같아요

아마 그렇게 ;)

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

아마 그렇겠죠 ;)

시도 - 도움이되지 않습니다.

다섯 번째 문자 없음

 //+------------------------------------------------------------------+
//|                                               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 :

시도 - 도움이되지 않습니다.

SD 응답:

지원팀 2015.11.20 14:33

4개의 레벨에서 4자리의 정확도로 표시됩니다.

이전에는 아무도 이에 주의를 기울이지 않았습니다. 따라서 이 곳은 지금까지 손대지 않았습니다.

표시기의 Digits 정확도로 출력하도록 합시다.

 

컴파일 오류

 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가 정적이면 충분합니다.