Errors, bugs, questions - page 2696

 
Alexey Viktorov:

There are no errors. As you can see in the screenshot the condition is fulfilled without any problems, but to see it in the debugger ... it should not be like this.

working with double and all the more under a debugger is a developer's job, it's not logical in ME, as I wrote above

I checked in VS - and under a debugger without problems.

Files:
asfdfg.jpg  295 kb
 
Alexey Viktorov:

So it is not two doubles that are compared, but as it is suggested in the documentation, the normalized difference is compared to zero. And even in the example, not the difference, but variable initialized by zero is compared to number zero...

And how can one evaluate that direct equality cannot be evaluated, but through ... ... it turns out that you can.

Why does not anyone check their system and tell me how it works? Andrei, you have not checked yourself?

Reproduced. I don't understand why I'm wasting my time on this. We have reported a bug and are working on it.

 
Andrey Khatimlianskii:

Reproduced. I don't see why we should waste our time on this. Reported a bug, move on.

I'm wasting my time on this to understand that it's not my computer's problem, it's a general problem. Thank you for checking.

Igor Makanu:

working with double and even more so under a debugger is a developer's job, it's not logical in ME all this, as I wrote above

i checked in VS - and under a debugger without problems

Igor, why check in VS if it says MetaEditor's problem.

Some time ago, when using the debugger a lot, I didn't notice this problem.

 
Alexey Viktorov:

Igor, why check in VS if it says MetaEditor's problem.

Don't make a hero of yourself.

But, for me, Microsoft and everything associated with it is a standard, and if it works there, it should work with other software similarly, so I check in VS and compare in ME

ZS: although you can rely on a well-known principle - MQL is not C++, it works differently here

 
Vladimir Pastushak:

What makes you think the angle will be measured from your square?

The angle is measured relative to the price and the scale of the chart.

Bring the graph to 1 point per 1 pixel and you will get your 45 degrees.

Thought the angle was measured relative to the first trendline point in pixels. The square acted as an approximate reference point. Thanks for the reply.

 
Evgeniy Zhdan:

Did you find the cause? Because it started happening to me yesterday too. Something with the quotes, I think.

Give me the link to the message. I don't remember anymore. ....
 

Bug MT5 (build 2375) when calling function for argument with data type color, implicit type conversation is applied despite the fact that there is a suitable by signature overloaded template function with data type color.
It was very difficult to catch and reproduce the bug because the problem only affects cases where a template class is used as the argument of a template function and its template parameter matches the template parameter of a function.

#define  PRINT(x) ; Print(#x, ":", string(x))

template<typename T>
class A : public T{};

class B {};
class C : public A<B>{};


template<typename _Tp>
class D{
   template<typename T>
   void test(const A<T>&, const long){PRINT(__FUNCSIG__);}
   
   template<typename T>
   void test(const A<T>&, const ulong){PRINT(__FUNCSIG__);}
   
   template<typename T>
   void test(const A<T>&, const color){PRINT(__FUNCSIG__);}
    
public:
   D(){
      C c;
      _Tp value = {};
      test(c, value);   // 'test' - ambiguous call to overloaded function
   }
};


void OnStart(){
   D<long> d_long;      // Ok
   D<ulong> d_ulong;    // Ok
   D<color> d_color;    // Compile Error
}
 
What's the problem here?
void OnStart()
{
  class CLASS
  {
  public:
    template <typename T> // template declarations are not allowed in local classes
    static void f( T ) {}
  };
  
  int i = 0;
  
  CLASS::f(i);
}


Itused to work.

 
fxsaber:
What is the problem here?


Itused to workbefore.

Declaring a class inside a function?

 
Stanislav Korotky:

Declaring a class inside a function?

You can do it in MQL, I haven't seen it anywhere, but it works, but I haven't tried it with templates

The only use I've found - you can describe a static instance of the class inside the function, and it is convenient to initialize complex calculations, so you can turn several functions that call each other in turn into a single function

i.e. "wrap a class into a function" - so on and so forth