Errors, bugs, questions - page 1729

 
fxsaber:

I create OBJ_CHART, and drag it around the top-left corner of the chart with my mouse. While dragging, ObjectDelete is called with successful result. MT5.

Also. If I drag OBJ_CHART and change its CHART-properties (ChartNavigate, for example), then there is no corresponding visualization.
 
Comments not relevant to this topic have been moved to "How to determine which indicator each sub-window belongs to".
 
A100:

Compilation error:

Appeared in build 1447
Thanks for the post, the passed parameter constancy control has been corrected.

There will now be a compilation error in both cases, the code should be modified to avoid the error:
template<typename T>
void f1( const T* const & a[] ) {}    << добавлена константность ссылки
class A {};
void f2( const A* const & a[] ) {}    << добавлена константность ссылки
class B {
        void g1() const { f1( a ); } //error: 'f1' - cannot to apply function template
        void g2() const { f2( a ); } //нормально
        A *a[];
};
 
константность ссылки

I haven't seen that anywhere. Is this the standard?

 
Ilyas:
Now in both cases there will be a compilation error, in order to avoid the error, the code should be changed:

Please check also this contradiction (here opposite - error at the bottom)

template<typename T>
void f1( const T& a[] ) {}
class A {};
void f2( const A& a[] ) {}
class B {
        void g1() const { f1( a ); } //нормально
        void g2() const { f2( a ); } //error: 'a' - parameter conversion not allowed
        A *a[];
};
 

How does MQL5 work with memory?

For example, there is the following code:

class Alfa {}
class Beta
  {
private:
   Alfa  *ptr_a;
   Alfa   obj_a;
public:
   Beta(void) { ptr_a = new Alfa(); }
  ~Beta(void) { delete ptr_a; }
   Metod(void) {...}
  }
//---

int OnInit(void) {
   Beta *ptr_obj = new Beta();
   Beta obj;
//---
   return INIT_SUCCEEDED;
}
void OnDeinit(const int reason) {
   delete ptr_obj;
}

according to which memory in "heap" will be allocated for ptr_obj object, and automatic memory will be allocated for obj object. If the operation of MQL5 memory manager is clear for these objects:

1. theptr_a object of theptr_obj object is allocated memory in the "heap".

2. Memory for objectobj_a of objectobj is automatically allocated

How the MQL5 memory manager is organized in these cases:

3. In which memory area will object obj_a of object ptr_obj be located?

4. in which area of memory will object ptr_a of object obj be located

 
A100:

Please also check this contradiction (here in reverse)

This is correct, here with typing, T = A *
 
void f( const A* &Array[] );

With this transfer, it is possible to swap the elements in the array (and size), but it is not possible to swap the elements themselves. Right?

void f( const A* const &Array[] );

And here the elements (and size) cannot be swapped either. Is it correct?

 
fxsaber:

I haven't seen that anywhere. Is this the standard?

Written so as not to write: there should be a reference to a constant array of pointers to constant objects
 
fxsaber:

With this transfer, it is possible to swap the elements in the array (and size), but it is not possible to swap the elements themselves. Right?

And here the elements (and size) cannot be swapped either. Is it correct?

Yes, that's correct.
Reason: