Errors, bugs, questions - page 1923

 
fxsaber:

The help states that: If no initial values are specified, static memory class variables take zero initial values. And besides - without template it's OK

 
A100:

The help says that: If no initial values are specified, static memory class variables take zero initial values

In the case of templates, I have an approximate idea of where the legs are coming from, hence the understanding that it is not possible to simply add a template line in all situations.

Technically, it is probably a mistake. Although, I think that the quoted text from the documentation was written long before the appearance of templates and is somewhat inaccurate.

 
fxsaber:

Although I think the quoted text from the documentation was written long before the templates were available and is somewhat inaccurate.

In the documentation there is the opposite entry:"A static classmember must be explicitly initialized with the required value". Only template does not affect this - so an error must or must not be generated in both cases (with and without template) - herein lies a contradiction
 
MetaTrader 5 build 1619 started (MetaQuotes Software Corp.)
Microsoft Windows XP (X86 based PC), IE 08.00, Intel Core2 Duo  T7700 @ 2.40 GHz, RAM: 2359 / 3581 Mb, HDD: 17612 / 27784 Mb, GMT+02:00
C:\Program Files\MetaTrader 5

MetaEditor no longer runs after the update, giving this error


1616 worked fine, 1619 did not.

In the terminal log after pressing F4

2017.07.07 12:00:30.109 Error   MetaEditor not found
2017.07.07 12:39:54.296 Error   MetaEditor not found
 
A100:

I don't quite understand the point of your IMHO. Take build <= 1596 (32bit) and check (outputs to .log file immediately [5-10 seconds] even one line). I checked it a minute ago.

[which cache? which always? there was something about something somewhere!?!]

I'm talking about Experts tab and MQL5\Logs\ folder.

IMHO it was written out of innate delicacy - a subtle hint of inconsistency in our experiences. For me, 5-10 seconds is by no means immediate. And that delay is not always limited to seconds according to my observations.

[Cache is cache, always is all the time until now, the question of delayed logging has already been discussed on this forum - if it's really important for you - search it].

 
Stanislav Korotky:

For me, 5-10 seconds is by no means immediate. And this delay is not always limited to seconds according to my observations.

It used to be 5-10 seconds (maybe more in some cases), and now without View menu - logs are not updated at all (!) (since the beginning of the day has passed several hours, and the file is zero, while the Experts tab has new lines for the day). Normal logging is disrupted for the sake of mythical "couple of nanoseconds" acceleration of the terminal
 

Compilation error

struct A {
        A() {}
        int aa;
};
struct B {
        static A a;
};
A B::a;
template<typename T>
struct C {
        static T a;
};
template<typename T>
T C::a;
void OnStart()
{
        B    x1;
        Print( x1.a.aa ); //нормально
        C<A> x2;
        Print( x2.a.aa ); //unresolved static variable 'C<A>::a'
}
Sounds like the previous case https://www.mql5.com/ru/forum/1111/page1943#comment_5410554 but you cannot hide the error here by specifying T C::a = 0; // A::A( int ) is missing
Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2017.07.06
  • www.mql5.com
Форум алго-трейдеров MQL5
 

Error during execution

void OnStart()
{
        string text = "1234\0";
        Print(  "1>'",    text, "'" ); //не выводит завершающую кавычку
        printf( "2>'%s'", text );      //нормально
}

Result:

1>'1234
2>'1234'

 

Compilation error

#define  MACRO( x )      Print( x )
void OnStart()
{
        MACRO/**/( 10 ); //error: '' - argument expected for the function-like macro
}
 

The opposite was expected

class A {};
struct B {
        const A *       a1;   //(1) есть сообщение об ошибке
              A * const a2;   //(2) нет сообщения
};
void OnStart()
{
        B b1;
        B b2;
        b2 = b1; //error: '=' - not allowed for objects with protected members or inheritance
}
  1. If struct B contains only line (1) - there is an error message
  2. If struct B contains only line (2) - no error message
  3. The opposite was expected

Further no error was expected in both cases (1. and 2.)

void OnStart()
{
        B b1;
        B b2 = b1; //error: '=' - not allowed for objects with protected members or inheritance
}
Reason: