
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
And with a little more brainwork, you can get a function like this
And if you rack up your brains a bit more you can get the following function
Why
Since the function is int, let return do the trick too.
and the call is probably like this
the result is
1) introducing ++ for enumeration
2) conversion of enumeration to string
On enumerations, there is a discussion:
1) introducing ++ for enumeration
2) conversion of enumeration to string
On transfers, there is a discussion:
1) introducing ++ for enumeration
Is this functionality already in place?
Or another alternative to list items sequentially?
It seems to me that incrementing an enumeration is not the right step.
The default enumeration does not necessarily have to be sequential, and besides, during development - values can be added to it "in the middle".
Of course, to "simplify" it would be nice to get immediate "next" value by incrementing enumeration, but in my opinion, this is a potentially dangerous practice.
To get the "next value" in the enumeration, the most reasonable thing is to use special function, as already mentioned here.
And people seem to ignore the default selector, and in vain. Every switch() must contain this selector with a warning that an obscure value has arrived.
George Merts:
by incrementing enumerations - getting the "next" value immediately
That's whatIlyas meant.
I had a question for him or the developer in charge. Has this problem been solved - somehow to go through all the elements programmatically or is it still in the process...
I don't really care how to pass
foreach operator
new functions like GetNextEnum / GetLastEnum / GetFirstEnum
or overload ++
as long as it is not as was suggested above - to draw functions for current denominations and then be afraid that nothing will break when they are updated by developers
God, why such complexities - some plussers, iterators... The most obvious and flexible solution is to introduce a function in the language that gets all enumeration values into an array. And then you decide how to traverse this array, even crosswise.Besides, you're going to have to save all the values anyway, since you're not going to re-hash everything on every call. Once you've bypassed it, stored it, and then you just take it from the array. So isn't it easier to get a ready array at once?
By the way, the variant with operator overloading ++ may cause incorrect work of existing programs, so it is an extremely bad way.
Well, the examples shown here (case 1: return value1; case 2: return value2; case 3: return value3... An adequate person would put all the values into an array and just get the needed value by its index, while for the reverse task he/she will use binary search.
God, what's with all the complexity - the pluses, the iterators...
I don't care how you want it to be.
Well, the examples shown here (case 1: return value1; case 2: return value2; case 3: return value3... An adequate person would put all the values into an array and just get the needed value by its index, while a binary search will be used for the reverse task.