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 здесь распространяется лишь на указатель, а не на объект по этому указателю
class A { public:
voidoperator[]( 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; }
};
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
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.
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:
voidoperator[]( 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 ]; } // нет ошибки
};
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 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
and then there would have been questions. But this is MQL5. The foolproof code is justified, IMHO.
Alexey Navoykov:
const здесь распространяется лишь на указатель, а не на объект по этому указателю
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
There are no constant pointers in MQL5!
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?!