错误、漏洞、问题 - 页 2064

 
fxsaber:
语言错误

用户代码中的错误不是错误:InitIndicators(CIndicator*)方法丢失了

 
A100:

用户代码中的错误不是一个错误:InitIndicators(CIndicator *)方法缺失。

字母s不见了,但编译器的信息 是错误的,所以SD采取了修复的方法。

 
fxsaber:

自卫队已经承担起修复它的任务。

你无法修复不包含错误的东西。在文件<Indicator.mqh>中查看 - 将有不带字母s的CIndicator 类。
 
A100:
你无法修复不包含错误的东西。在文件<Indicator.mqh>中查看 - 将有一个不带字母s的CIndicator类。

请给SR写信说明。他们声称(不是我),有一个错误,将被纠正。

 
fxsaber:

请给SR写信说明。他们声称(不是我),有一个错误,将被修复。

你最初陈述了这个错误--你能解释一下它是什么吗?它有什么问题呢?以下是简化后的代码。

class A1 {}; //Indicators
class A2 {}; //Indicator
class BB {
public:
    void f( A1 * ) {}
};
class B : public BB {
public:
    void f( A1 * ) {}
};
void OnStart()
{
    A2* a;
    B b;   
    b.f( a ); //error: 'f' - no one of the overloads can be applied to the function call
}
 
fxsaber:

请给SR写信说明。他们声称(不是我),有一个错误,将被纠正。

编译器的错误信息 并不十分正确。

编译器将虚拟方法覆盖视为重载,我们将修复它。
 
这是正确的编译器信息 吗?
int Tmp = 2;
  
if (Tmp % 2) // expression not boolean
 

这是一个错误吗?

// Добавление элемента в конец произвольного массива
template <typename T>
void AddArrayElement( T &Array[], T Value, const int Reserve = 0 )
{
  const int Size = ArraySize(Array);
  
  ArrayResize(Array, Size + 1, Reserve);
  
  Array[Size] = Value;
}

class A {};
class B : public A {};

void OnStart()
{
  A* Array[];
  
  A* a = new B; // no problem
  AddArrayElement(Array, (A*)(new B)); // no problem
  
  AddArrayElement(Array, new B); // template parameter ambiguous, could be 'A*' or 'B*'
}
 

我如何从一个文件的句柄知道它的名字?

 
语言或句法的局限性?
struct A
{
  int i;
};

struct B
{
  const A a;
  
  B() : a({0}) // 'a' - constructor not defined
  {
    const A b = {0}; // no problem
  }  
};
原因: