It was the code optimiser that threw everything out and left the function empty. The breakpoint moved to the same end of the function and worked.
I got a little excited with the first example, I agree. But what about the second one? Well, the breakpoint remains inside the condition and does not move anywhere. The triggering of a breakpoint misleads the user into thinking that the input condition has been met, when in fact it might not be so at all:
class A{
public:
bool m_flag;
A* m_next;
A(bool flag) : m_flag(flag){}
void test(){
if(m_flag){
printf("1");
m_next = m_next; // Вручную установленная точка останова срабатывает как для false так и true условий//m_next = &this; // Ok
}
}
};
voidOnStart(){
{A a(false); a.test();} // Result: breakpoint Expected result:
{A a(true); a.test();} // Result: printf + breakpoint Expected result: printf + breakpoint
}
namespace NameSpace{
struct A{};
template<typename T>
struct B : public A{}; // 'A' - declaration without type
};
struct D : public NameSpace::B<int>{
int data;
};
voidOnStart(){
D d;
}
Why inOBJ_TRENDBYANGLE we can't know the angle programmatically?
We can set the time and prices of the two points programmatically, but the angle returns 0.
If we move OBJ_TRENDBYANGLE manually, the normal angle value is returned.
I want to simply place text on the trendline at the same angle as the trendline itself.
But the trendline does not return the angle, while OBJ_TRENDBYANGLE has a fixed second coordinate and when the chart scale changes as a result of rise or fall in price, we get false information...
Структура является набором элементов произвольного типа (кроме типа void). Таким образом, структура объединяет логически связанные данные разных типов. Объявление структуры Имя структуры нельзя использовать в качестве идентификатора (имени переменной или функции). Следует иметь ввиду, что в MQL5 элементы структуры следуют непосредственно друг...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The code shows a BAG where a condition cannot be entered, but still triggers a breakpoint in a completely different place in the code.
More questions?
The code optimizer threw everything away and the function is left empty.
The breakpoint moved to the very end of the function and triggered.
It was the code optimiser that threw everything out and left the function empty.
The breakpoint moved to the same end of the function and worked.
I got a little excited with the first example, I agree.
But what about the second one? Well, the breakpoint remains inside the condition and does not move anywhere.
The triggering of a breakpoint misleads the user into thinking that the input condition has been met, when in fact it might not be so at all:
The breakpoint moved to the same end of the function and worked.
Do you think this is not a bug?
C++ online:https://onlinegdb.com/S1E503pj8
Forum on trading, automated trading systems and strategy testing
OOP questions in MQL5
fxsaber, 2020.05.30 10:04
Got an unexpected result.Why inOBJ_TRENDBYANGLE we can't know the angle programmatically?
We can set the time and prices of the two points programmatically, but the angle returns 0.
If we move OBJ_TRENDBYANGLE manually, the normal angle value is returned.
I want to simply place text on the trendline at the same angle as the trendline itself.
But the trendline does not return the angle, while OBJ_TRENDBYANGLE has a fixed second coordinate and when the chart scale changes as a result of rise or fall in price, we get false information...
Why does the compiler give a warning ?
UPD: no
int ArrayInitialize( uchar array[], uchar value );
it is not convenient to write
401code - what is the error ?
what's up?
401
Inheritance from this class is impossible because it is declared with specifier final
Why does the compiler give a warning ?
UPD: no
int ArrayInitialize( uchar array[], uchar value );
is not convenient to write
0xFF is probably turned into 4 bytes by the compiler.
401code ,can someone tell me what is this error ?
found
401
Inheritance from this class is impossible because it is declared with specifier final
What's the question - there is no final modifier, but there is an error, or what?