Errors, bugs, questions - page 2420

 

Why would mql5 move semantics? There's no need for such performance optimisation, especially since it's a virtual machine. What else do you need it for?)

On its own, mql5 is very different from C++, as well as fromC++98, and even more so from C++11/14/17, but its capabilities now completely cover the things you need to create an EA.

 
Andrey Pogoreltsev:

but its capabilities now fully cover the things you need to create an EA.

They covered those necessities even 6 years ago in the old MQL4, if you have any idea what the level of the language was in those days. We wrote EAs in it, and some still code in that archaic style. So everything is relative.

What other purpose would it be introduced for?)

This has been discussed for the last couple of pages of the thread.
 

It gives an error here:

void OnStart()
  {
   struct sA
     {
      int               ii[51];
     };
   struct sB
     {
      string            name;
      sA                distrib;
     };
   sB f;
  }
'distrib' - struct undefined    Test2.mq5       21      25

It doesn't go like this:

void OnStart()
  {
   struct sA
     {
      int               ii[51];
     };
   struct sB
     {
      //string            name;
      sA                distrib;
     };
   sB f;
  }

This doesn't work either:

struct sA
  {
   int               ii[51];
  };
struct sB
  {
   string            name;
   sA                distrib;
  };

void OnStart()
  {
   sB f;
  }

Attached is a script to reproduce the error, an empty script with a couple of lines of code as above.

Files:
Test2.mq5  1 kb
 

Well, that doesn't make sense at all:

class A
  {
   class B
     {
      class C
        {
         class D
           {
            class E
              {
               bool              YES;
              };
           };
        };
     };
  };
void OnStart()
  {
   E g;
  }

Class E doesn't deserve to be so popular.

It compiles without any errors.

 
Is it a compiler error?
class A
{
private:
  int i;
};

class B : public A
{
public:  
  void f( int i ) {} // declaration of 'i' hides member declaration at line 4
};
 
fxsaber:
Is it a compiler error?
Could it be a formatter's annoying chattering about bullshit that distracts from serious business?
 
fxsaber:
Is it a compiler error?
in the pluses the same thing
 
Vict:
Maybe an annoying formchanist talking about bullshit, distracting you from the serious stuff?

when you're in the midst of his enthusiasm, will you tell me then?

 
fxsaber:
Is it a compiler error?

It's kind of logical.

How can the input parameters in a public function be private. Conflict of interest.

If this private parameter is to be used inside this function, it doesn't need to be declared as input, because it already exists.

If it's meant to be another variable, of course there will be a name conflict within the function with the existing private variable and so it needs to be called by a different name.


ZS It turns out it doesn't matter if it's i public or private. It's a trivial name conflict. Inside function f there will be uncertainty what i is - input parameter or global variable of parent class.

 
Nikolai Semko:

the question implied that we can't access the member because of privacy, but the name conflict is still shown by the compiler.

as I wrote, the pluses behave exactly the same, i.e. there is no error in the compiler and all is well.

Reason: