![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 am right.
There is a need for the standardization of the representation of absent of values (henceforth referred to as "None"). Currently, the way to set a variable to None is to set it at the edge of its limit. (eg. double x = DBL_MAX) These vary greatly from type to type. Additionally there is currently no way to set None values using templates. This library solves these issues. If you want to continue using a plethera of MQL constants and making overloaded funcitons instead of using template then don't use it. Those who understand the concept of None will instantly see the value in having both 1. new constants defined with prefix NONE_XXX and 2. A macro which you can pass the type and receive the None value in return. Either can be used or None (pun intended), it's your choice.
I agree with you about the need, I just think there is more then one way to solve the problem, there is not a must for using a static class and it doesn't mean you have to have plethora of MQL constants and overloaded functions, for example if you use CObject.
Ok... then please allow me to present a challenge for you. Show me how I can do this...
...without cluttering the global namespace with unnecessary functions.
Just to make sure we're on the same page... I'm using the naming convention for marking something private (i.e. _NoneType) for a class with only static methods as a way to create a private namespace, which I'm doing intentionally to keep the functions out of the global namespace. The only things globally exposed are the NONE_TYPE constants and the NONE macro.
Edit: and while we're on the topic of namespace, MQL allows inline scoping. Within this scope you can define functions inside of functions provided you use the class/static method pattern. I'm pretty sure this has to be new because I don't remember class definitions obeying scope in the past.
Ok... then please allow me to present a challenge for you. Show me how I can do this...
...without cluttering the global namespace with unnecessary functions.
Once again I have to tell you that I write the code for classes only. Did you place a global function on purpose or you just not listen to what I say? If you make it a method of a class I can post a code.
Just to make sure we're on the same page... I'm using the naming convention for marking something private (i.e. _NoneType) for a class with only static methods as a way to create a private namespace, which I'm doing intentionally to keep the functions out of the global namespace. The only things globally exposed are the NONE_TYPE constants and the NONE macro.
Again I'm hearing arrogance, you seem to not believe that I understand what you mean.. why is that?
Once again I have to tell you that I write the code for classes only. Did you place a global function on purpose or you just not listen to what I say? If you make it a method of a class I can post a code.
Again I'm hearing arrogance, you seem to not believe that I understand what you mean.. why is that?
Because you don't seem to understand that I'm using a class as a pseudo namespace and that None has to be global and not a class member.
The only method available is None<>() - just one method, protected.
And the templated ArrayRing (you can find the Init() inside, as you wanted)
test
No, it's not because I don't "seem" to understand. It seems like you can not comprehend that I can understand and disagree.
The only method available is None<>() - just one method, protected.
And the templated ArrayRing (you can find the Init() inside, as you wanted)
test
Your code, however you decide to implement it, should be able to compile and pass these unit tests.
I am right.
There is a need for the standardization of the representation of absent of values (henceforth referred to as "None"). Currently, the way to set a variable to None is to set it at the edge of its limit. (eg. double x = DBL_MAX) These vary greatly from type to type. Additionally there is currently no way to set None values using templates. This library solves these issues. If you want to continue using a plethera of MQL constants and making overloaded funcitons instead of using template then don't use it. Those who understand the concept of None will instantly see the value in having both; 1. new constants defined with prefix NONE_TYPE and 2. A macro which you can pass the type and receive the appropriate None value in return. Either can be used or None (pun intended), it's your choice.
Your code, however you decide to implement it, should be able to compile and pass these unit tests.
I showed you that I can template, and standardize without using the static class (it does not matter to me you restrict the access with a macro).
Then you are redefining the purpose of 'None' for your own edge case and need to open your own thread because we are not discussing the same concept.
Then you are redefining the purpose of 'None' for your own edge case and need to open your own thread because we are not discussing the same concept.