The future of MQL5 is MQL5+ or even MQL6 - page 12

 
Slawa:
Show me the source code
// TestCPPCode.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

class Base {
private:
        int a;
public:
        virtual int Func1();
};


class Second : public Base {
public:
        int Func2() {
                return 0;
        };
};

int OnInit() {

        Base* base = new Base();
        Second* foo = new Second();
        return 0;
}


int main()
{
    return 0;
}
 
Alexey Volchanskiy:
Project with default settings
 
Alexey Volchanskiy:
Project with default settings

This is because of virtuality. The virtual function table must be fully populated.

In MQL5, we simply cut unused functions and thus reduce our virtual function table. And if there is no body, there is nothing to cut out

 
Slawa:

This is because of virtuality. The virtual function table must be fully populated.

In MQL5, we simply cut out unused functions, thus reducing our virtual function table. And if there is no body, there is nothing to cut out

That's clear, it's a normal approach.
 
Slawa:

1. Pure virtual functions will be added soon

2- And where in your example is Func1 being called? No call - no body control.

1. fine

2. ok

 

That's the kind of thing I'd like:


 
Vasiliy Sokolov:

That's the kind of thing I'd like:

Then normal properties, like in C#. This topic has already been raised many times. Why haven't they made them in C++ 11? I don't understand.

Here's how people get around http://stackoverflow.com/questions/8368512/does-c11-have-c-style-properties

Does C++11 have C#-style properties?
Does C++11 have C#-style properties?
  • stackoverflow.com
In C#, there is a nice syntax sugar for fields with getter and setter. Moreover, I like the auto-implemented properties which allow me to write Is there some such concept in the C++11 allowing me to have some syntax sugar on this?
 

I would like to be able to use not only local agents (my computer), but also those in the local network when optimizing the EA with DLL.

After all, if I have access to the computer in the local network to install the terminal and test agents, respectively, I can do anything with this computer (e.g. format it). I.e. security of DLL will not worsen, everything is under my control, up to complete demolition of the system by hand.

And the plus side would be faster optimization. Leave the Cloud Network agents as they are, without the DLL.

 
elibrarius:

I would like to be able to use not only local agents (my computer), but also those in the local network when optimizing the EA with DLL.

After all, if I have access to the computer in the local network to install the terminal and test agents, respectively, I can do anything with this computer (e.g. format it). I.e. security of DLL will not worsen, everything is under my control, up to complete demolition of the system by hand.

And the plus side would be faster optimization. The agents in the Cloud Network should be left as is, without the DLL.

You can do this right now.

Run the agents on the local network with the /dlls switch

 
Slawa:

You can do this right now

Run agents on the local network with the /dlls switch

Thank you, it helped! )