-
If you complain about an error please provide the error messages in the logs.
-
See here about the use of templates: https://www.mql5.com/en/book/oop/templates/templates_objects.
- Or place the cursor on template and press F1 ..
MQL5 Book: Object Oriented Programming / Templates / Object type templates
- www.mql5.com
An object type template definition begins with a header containing typed parameters (see section Template Header ), and the usual definition of a...
Popescu Paul:
As I was writing my code (posting it is not relevant for this subject) I've run into some problems related to various functions where I declared parameters as const& (constant references) to objects. These errors were caused by the library.
When I looked in the library code, sure enough, no method is declared as const even though it doesn't modify the object. Down below I've attached an example of two methods that, in my mind, should be declared as const.
Being unable to declare an object as const is problematic for code robustness and debugging, as you all know. So, am I wrong here? Or is the library code just poorly written?
As I was writing my code (posting it is not relevant for this subject) I've run into some problems related to various functions where I declared parameters as const& (constant references) to objects. These errors were caused by the library.
When I looked in the library code, sure enough, no method is declared as const even though it doesn't modify the object. Down below I've attached an example of two methods that, in my mind, should be declared as const.
Being unable to declare an object as const is problematic for code robustness and debugging, as you all know. So, am I wrong here? Or is the library code just poorly written?
It's just poorly written.
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
When I looked in the library code, sure enough, no method is declared as const even though it doesn't modify the object. Down below I've attached an example of two methods that, in my mind, should be declared as const.
Being unable to declare an object as const is problematic for code robustness and debugging, as you all know. So, am I wrong here? Or is the library code just poorly written?