Errors, bugs, questions - page 3102

 
mktr8591 #:
similarly - (const A*) convert to A*.
It's not quite clear what you want to convey to fxsaber. He understands exactly what is going on in the code without you. It just shows you a situation that shouldn't be. The compiler should prevent such conversions.
 
Sergey Gridnev #:
It is not quite clear what you want to convey to fxsaber. What exactly is going on in the code is something he understands without you. It only shows a situation that shouldn't be there. The compiler should suppress such conversions.
It's a debatable point. Without these conversions you may get a lot of trouble in some places. Moreover, even such bans of the compiler can be bypassed - there are a lot of ways in the forum.
 
mktr8591 #:

And the *2* line compiles and works fine. Why?

The initialization list is the only legal (and specifically provided) way to initialize non-static constants.

 
Andrei Trukhanovich #:

The initialisation list is the only legal (and specifically intended) way to initialise non-static constants.

So he changed its value afterwards

 
A100 #:

So he changed her meaning afterwards.

Yeah, inattentive. Bug? The features of the initialization list should only apply to the object being constructed

 
Andrei Trukhanovich #:

Yeah, inattentive. Bug? The features of the initialisation list should only be relevant to the object being constructed

Bug. I didn't understand it at first either. That's why I'm saying that you should write it in such a way that most of the people understand it. This also applies to the interface

 
A100 #:

Bug. I didn't understand it right away either. That's why I say you should write it in such a way that the vast majority of people understand it. This also applies to the interface.

I agree about bug reports, of course.

The interface is another story. Example :

If a pilot, who knows how to fly a plane perfectly well, switches to another type of plane with a different control system, without studying the manuals, he won't understand a lot.

It is impossible to make a complex interface that even most professionals can understand without studying the documentation.

 
It's a compilation error:
class T {};                          //(1)
template<typename T> void f( T* ) {} //(2) Error: 'T' - identifier already used
And if you swap:
template<typename T> void f( T* ) {} //(2)
class T {};                          //(1)

it's fine. What's the fundamental difference?

 
Hi all! I've recently started training on a demo account. Today I opened: Help - MQL5web-terminal. After that the trading platform stopped loading. When I did, it turned out that my demo account was wiped with all technical analyses I had trained there. I had to open a new account. Why did this happen? Does this happen to real accounts?
 
mktr8591 #:

In b3095 I run a script:

If you remove the overload f1(T* & Ptr), all 5 calls return void f1<const X>(const X*const).

Is this some kind of feature?

I wanted to write this contradiction into 3 lines, but it did not work at once

Reason: