Errors, bugs, questions - page 1587

 
Anton Zverev:
I'd love to learn, but Google doesn't understand where I went wrong. Could you summarise my misunderstanding? I see a compiler error in your example at the "normal" line. In my mind, the compiler should have blamed it.
const here only applies to a pointer, not to an object by that pointer
 
Alexey Navoykov:
const here refers only to the pointer, not to the object by this pointer

I know what you mean. But I think there must be a mistake.

If it were not MQL5, we would have to write something like this

(*a).operator[]( 0 );
a->operator[]( 0 );

and then there would have been questions. But this is MQL5. The foolproof code is justified, IMHO.

 

Alexey Navoykov:
const здесь распространяется лишь на указатель, а не на объект по этому указателю

class A { public:
        void operator[]( int i ) {} // const отсутствует
};
class B { public:
        const A *a; // к чему относится здесь const?
        B(){a = new A; // явно не к указателю - нет ошибки
            a[0];} //логично: 'operator[]' - call non-const method for constant object
        ~B() { delete a; }
};
 
There are no constant pointers in MQL5! I couldn't think of an example when this is a bad thing.
 
When a five crashes, where do I look at the crash log?
 

I have several accounts in the terminal of the A's in my favourites. I would like to connect to these accounts one by one and retrieve the required information.

Has anyone made such a connection through WinAPI? Please share, please.

I am looking for the broker with the best demo prices for the symbol. The idea is like this

  1. Open demo accounts at each of the brokers.
  2. Put them in my favourites.
  3. Login to each of the Favorites, read the average spread.
  4. Record the data in the general table.

 
How do I find out the full list of trading servers in Five? Search only works for >=4 characters. Going through a variant of four characters via WinAPI is a shitty solution.
 
Anton Zverev:
const A *a; // к чему относится здесь const?
        B(){a = new A; // явно не к указателю - нет ошибки
...
There are no constant pointers in MQL5!
You've been told correctly: study the math. In your example, it's a pointer to a constant object, not a constant pointer.
 
Build 1340. For the current day copyticks were getting kotirs, but with a hole for about an hour (no data). Only a re-login helped.
 
Alexey Navoykov:
You were told correctly: study the math. In your example, it is a pointer to a constant object, not a constant pointer.

Then where do you think the constant pointer is?!

class A { public:
        void operator[]( int i ) const {} // const добавил
};
class B { public:
        B() : a( new A ) {}
        ~B() { delete a; }
        A *a;
        void f() const { a.operator[]( 0 ); } // нет ошибки
        void g() const { a[ 0 ]; }            // нет ошибки
};
Reason: