Errores, fallos, preguntas - página 1434

 

Error de compilación:'<' - error de plantilla

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

Error de compilación:'<' - error de plantilla

Gracias.
 

No se puede especificar el nombre completo para el constructor y el destructor dentro de una declaración, mientras que sí se puede para los métodos (¿y por qué los primeros son peores?)

class A {
        void A::f() {}     //нормально
               A::A() {}  //Error: '::' - name expected
        virtual A::~A() {} //Error: '::' - name expected
};
¿Por qué es necesario? - resultó ser la única manera de separar la declaración y la implementación en las plantillas.
 

Haga algo con respecto a la ventana de cierre de pedidos.
Los números de pedido no son totalmente visibles. Cuando se modifica el ancho de una columna, ésta no es fija y se vuelve a estrechar. Y la propia ventana no se puede estirar.


 

No se puede imprimir el quinto dígito con 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);
  }
//+------------------------------------------------------------------+

Resultado:

NO5-Znak

 
IndicadorDígitos. No sé cómo se llama en este momento. Creo que alguien podría decirme.
 
Комбинатор:
IndicadorDígitos. Ahora no sé cómo se llama. Creo que alguien me lo dirá.

Debe ser eso ;)

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

Debe ser eso ;)

Lo he probado, pero no sirve de nada.

No hay quinto dígito

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

Lo he intentado, pero no funciona.

Respuesta SD:

Equipo de apoyo2015.11.20 14:33

En los cuatros, los niveles se emiten con una precisión de 4 dígitos.

Nadie solía prestar atención a esto. Por eso este lugar no se ha tocado hasta ahora.

Hagamos que salga con laprecisión del indicador Digits

 

Error de compilación

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
Basta con que B::a sea estático
Razón de la queja: