Errors, bugs, questions - page 2735

 
I have a question, how can I find free signals now? I periodically find them manually, but the signals page only shows paid signals. Filtering by value doesn't allow me to find them.
 
Recompiling a library connected to the Expert Advisor selected in the tester does not pick it up on the next run. I have to select another Expert Advisor in the tester, then switch to the previous one. Only then tester picks up new library. Completely unobvious bug.
 
Stanislav Korotky:
Recompiling the library connected to the Expert Advisor, which is selected in the tester, does not result in it being picked up at the next startup. I have to select another Expert Advisor in the tester, then switch to the previous one. Only then tester picks up new library. Completely unobvious bug.

It's the same in the stable version...

 
MT5 bug (build 2407) compilation error when class contains a pointer to a wrapper class that uses this class as a field.
C++ online: https://onlinegdb.com/SJN1shM58
template<typename T>
class wrapper{
public:
   T data;
};

class B{
public:
   wrapper<B>* ptr;             // undefined class 'B' cannot be used
};


void OnStart(){  
   B b;
   b.ptr = new wrapper<B>();
   printf("%p", b.ptr);
} 
 
A compilation error:
int i = f(); //Error: 'f' - undeclared identifier
void OnStart()
{
}
int f() { return 0; }

but otherwise:

void OnStart()
{
int i = f(); //нормально
}
int f() { return 0; }

fine. What difference does it make?

 
A100:
It's a compilation error:

but this way:

this is how you should write your first example - with a forward description, by the way a forward description for structures and classes works too

int f(int);
int i = f(5);
void OnStart()
{
   printf("i = %i", i);
}
//+------------------------------------------------------------------+
int f(int v)
{
   return v * v;
}
//+------------------------------------------------------------------+

2020.05.10 17:23:27.704 tst1 (ETHUSD,M1) i = 25

A100:

ok. What is the difference?

I think the compiler parses the compiler from top to bottom and at the end, OnStart() will be analysed last
 
Igor Makanu:
I think the compiler parses the compiler from top to bottom and OnStart() will be analyzed last

In this case, there is no need to think - the rules should be general: if a function can be applied before the declaration, then it can, if not, then it cannot. Accordingly, both cases must either compile or not

 
A100:

In this case, there is no need to think - the rules should be general: if a function can be applied before the declaration, then it can, if not, then it cannot. Consequently, both cases must either compile or not.

alas, this is called a language feature, you can write it this way

int f(int v)
{
   return v * v;
}
void OnStart()
{
   printf("i = %i", i);
}
//+------------------------------------------------------------------+
int i = f(5);
 
Igor Makanu:

Alas, these are called language peculiarities, you can write it that way.

All peculiarities are reflected in the Documentation. I haven't seen this one there. Hence the conclusion: that it is not a feature, but a flaw

 
A100:

In this case, there is no need to think - the rules should be general: if a function can be applied before the declaration, then it can, if not, then it cannot. Accordingly, both cases must either compile or not.

This is the normal behavior of C of such languages.

Without a forward function declaration, they cannot be used. A call from OnStart actually compiles delayed compared to a direct call at the global level.

In C++, the exact same error will be generated.

Reason: