Errors, bugs, questions - page 1032

 
stringo:
By the way, what did you mean by trying to organise the left shift by 35 (which is the number the literal '5' converts to)?
It was a simplified example as much as possible. The point was to overload the operator. This leaves you with the explicit transformation
 
A100:
This was a simplified example as much as possible. The point was precisely to overload the operator. This leaves us with an explicit transformation.
Thank you for simplifying the example. Such simplifications are very convenient for parsing errors
 
Another inconsistency
class A {
public:
        virtual int f() { return ( 1 ); }
};

class B : public A {
public:
        virtual int f() { return ( 2 ); }
};

int g( A& a )
{
        return ( a.f() );
}

void OnStart()
{
        B b;
        Print( g( b ) ); // результат: 1
}
Whereas a similar construction in C++ returns result: 2, which is logical because the object is B and not A
 
A100:
Another inconsistencyWhile a similar construction in C++ returns result: 2, which is logical, because the object is exactly B, not A
Yes, it looks like an error, thanks for finding it - we'll definitely check and fix it.
 
The items in the vote, are not auto-translated.
 
MetaDriver:

How's that going for you?

I can't reproduce your situation for a simple reason: I don't have a :

Yes it was in the file download that was the error, not the buffers. It seems to have moved on now.
 
Al_key:
Yes, there was an error in the file download, not in the buffers. Now it seems to have moved on.

One more question:

Do you have an example of how to run a custom indicator on small charts (the ones that have objects and can be thrown on top of the main chart)? I use in MT4 currency indexes and it would be very cool to see them in a small mobile window of MT5, instead of wasting half of the screen.

 
The signal copies the deal, but the volume is always 0.01 and the seller's is different. What should I do? I want the volume to be the same as the seller's.
 
A100:
This is from the MQL5 Reference:

Any single character enclosed in single quotes or hexadecimal ASCII character code as '\x10' is a character constant and is of type ushort.

The question then arises why the compiler cannot distinguish ushort from int - without explicit specifying?
Found the reason, it turns out the compiler considers a single character in quotes, e.g. '5' not ushort, but short, as the example confirms:
class A {
public:
        int operator<<( ushort ch ) { return ( 1 ); }
        int operator<<( short  ch ) { return ( 2 ); }
        int operator<<( int   ch ) { return ( 3 ); }

        int f( ushort ch ) { return ( 4 ); }
        int f( short  ch ) { return ( 5 ); }
        int f( int   ch ) { return ( 6 ); }
};

int h( ushort ch ) { return ( 7 ); }
int h( short  ch ) { return ( 8 ); }
int h( int   ch ) { return ( 9 ); }

void OnStart()
{
        A a;
        Print( a << '5' );  // результат: 2
        Print( a.f( '5' )); // результат: 5
        Print( h( '5' ));   // результат: 8
}

Everything compiles, works and does not require specifying explicit conversions.

Accordingly, either the description doesn't match the compiler, or the compiler doesn't work according to the description. I would like a match.

 

what can it be:

critical runtime error 1079902208 in OnTick function (unknown error)

testing 2 hour time frame

Checking for available tools is worthwhile.

Reason: