Errors, bugs, questions - page 1963

 
A100:
If the difference is huge, then why do both variants compile normally in C++?

Here is no authority at all on C++ in this case, as I based my conclusions on logic. Above, I reworked the example with a dereference.

All you have to do is to make such a substitution

// typedef void (*fn)();
typedef void (*fn123)();

How the dereference will be completely different. You may ask the compiler to be "smarter than a fool" and act the way it does in C++. But this solution is debatable really.

I.e. such "help" can be implemented in the compiler, but the difference in approaches is shown.

 
A100:
is fine. What difference does it make?

apparently, f is not seen as a pointer to a function in a simple pass to the compiler.

 
Комбинатор:

apparently, when passed to the compiler, f is not taken as a pointer to a function.

I agree (it's simple and there is essentially no difference)
 
Комбинатор:

apparently, when passed to the compiler, f is not taken as a pointer to a function.

And it shouldn't, at least because of ambiguity.

typedef void (*fn)();

template<typename T>
void g( T Value ) { Print(typename(Value)); }
void f() {}

void g( fn Value ) { Print(typename(Value)); }
void OnStart()
{
  g( f ); // void(*fn)()

  int f = 0;  
  g( f ); // int
}
 
fxsaber:

And it shouldn't, if only because of the ambiguity

There was no such ambiguity in the original example... you created it... and you used it to explain everything.
 
fxsaber:

And it shouldn't, if only because of the ambiguity

In the original typedef is an alias for a type, not another type, so it's really a big question for the developers why the type name displays an alias instead of a type.
 

Error during compilation

struct A {
                void f() {}
        static  void f( int ) {}
};
template<typename T>
void g( T ) {}
void f( int ) {}
typedef void (*fn)( int );
void OnStart()
{
        g(  (fn)   f ); //(1) нормально
        g(  (fn)A::f ); //(2) error: '(void(*fn)(int))' - cannot resolve function address
        fn ff = A::f;
        g( ff        ); //(3) нормально
}

If (1) is OK, why an error in (2) if (3) is OK???
 
Комбинатор:
In the original typedef is an alias for a type, not another type, so it's really a big question for the developers why the type name displays an alias instead of a type.

I agree.

 

A100:

template<typename T>
string typeof( T ) { return typename T; }

Please explain the typeof. I couldn't find a good explanation for inexperienced programmers.

 
During a single run and visualisation the logs are filled with thousands of entries of this kind
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order modified [#253  buy limit 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order modified [#253  buy limit 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order modified [#253  buy limit 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order modified [#253  buy limit 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order modified [#253  buy limit 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   take profit triggered #251  sell 1.00 EURUSD 1.18166 tp: 1.18159 [#254  buy 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   deal #251  buy 1.00 EURUSD at 1.18159 done (based on order #254)
2017.08.16 20:26:06.477 2017.08.01 10:04:06   deal performed [#251  buy 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order performed buy 1.00 at 1.18159 [#254  buy 1.00 EURUSD at 1.18159]
2017.08.16 20:26:06.477 2017.08.01 10:04:06   order [#253  buy limit 1.00 EURUSD at 1.18159] triggered

And you have to wait for long seconds for them to show up. And I'm only interested in the log, which I do myself in OnDeinit. Why do I need to force every time these logs, which are read in VERY rare cases? There is a special menu item in Agent Log Viewer. And the absence of these logs during optimization does not make anyone feel incomplete. So why all this obtrusiveness in hundreds of megabytes (especially if some bad EA is trying to open a deal at every tick, getting Unsupported filled mode)?

Is it possible to separate flies from cutlets in the tester? The same as in the terminal: a log for the prints from the EA itself and a log of the terminal. Tired of waiting for long seconds while those tens of thousands of unnecessary messages in the log for each order-point to pass and you can see the last lines of backtest completion.

It's been a long time coming. I might not be the only one annoyed.

Reason: