You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I don't consider I played a serious role on this, it's Dominik's merit, he has demonstrated it's "possible".
I am personally not satisfied with such solution, having to write 4 versions (at least) of a method each time you need something "generic". This is not even considering the const correctness. I am still hoping and trying to have some improvements on MQL itself. We will see.
Everyone is free to use it or not, so that's a step forward.
There might be slight improvements to this 4 versions of a method each time, like:
template <typename CALL_TYPE> const int push(CALL_TYPE p_in) { CALL_TYPE pass=p_in; return push(pass); // call reference type for primitive literal };
Which btw demonstates in my opinion that MQL might improve in that at least do it automatically (passing int primitive as reference that is like c++ does) instead of letting us do it manually like that
And also it's possible for the pointer version to the reference type - which leaves us with 2 versions of the same method only
Which also means in my mind, that if we have only the reference signature, MQL can make it by it's own and save us from needing to specify this pointer signatureThere might be slight improvements to this 4 versions of a method each time, like:
Which btw demonstates in my opinion that MQL might improve in that at least do it automatically (passing int primitive as reference that is like c++ does) instead of letting us do it manually like that
And also it's possible for the pointer version to the reference type - which leaves us with 2 versions of the same method only
Which also means in my mind, that if we have only the reference signature, MQL can make it by it's own and save us from needing to specify this pointer signatureI don't consider I played a serious role on this, it's Dominik's merit, he has demonstrated it's "possible".
I am personally not satisfied with such solution, having to write 4 versions (at least) of a method each time you need something "generic". This is not even considering the const correctness. I am still hoping and trying to have some improvements on MQL itself. We will see.
Everyone is free to use it or not, so that's a step forward.
Just to be sure, the calling of ref signature from ptr signature does not create a copy of the object, it just passes its reference.
Just to be sure, the calling of ref signature from ptr signature does not create a copy of the object, it just passes its reference.
template <typename CALL_TYPE> const int push(CALL_TYPE p_in) { CALL_TYPE pass=p_in; return push(pass); // call reference type for primitive literal };
template <typename CALL_TYPE> const int push(CALL_TYPE p_in) { return push(p_in); // call reference type for primitive literal };
Ok, I know that. For some reason I changed it because I have a different implementation of the fifo_buffer from yours, and I copied from mine to your's and it got somehow confused.
But I tested the passing of an object to a ref, just to be sure it does not create a copy of the object (which it does not)
But using that shifting from ptr to ref still has a drawback for derived classes, which it does not resolve into the reference type
Ok, I know that. For some reason I changed it because I have a different implementation of the fifo_buffer from yours, and I copied from mine to your's and it got somehow confused.
But I tested the passing of an object to a ref, just to be sure it does not create a copy of the object (which it does not)
But using that shifting from ptr to ref still has a drawback for derived classes, which it does not resolve into the reference type
It's totally accepted, you did a great job again. The shifting from class level templating to method templating level on top of class templating to achieve isolation of the calls was a brilliant idea.
It's totally accepted, you did a great job again. The shifting from class level to method templating level on top of class templating to achieve isolation of the calls was a brilliant idea.