Errors, bugs, questions - page 1768
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
This is only possible in a dumb compiler. You know it yourself.
using namespace std;
struct S
{
S operator +(const S&) {cout << "operator +\n"; return S{};}
};
S operator ""_s(const char*, size_t) {cout << "literal operator\n"; return S{};}
int main()
{
cout << "___literal concatenation example___\n";
S s = "sd"_s "sf"_s;
cout << "___operator+ example___\n";
S s2 = "sd"_s + "sf"_s;
}
___literal concatenation example___
literal operator
___operator+ example___
literal operator
literal operator
operator +
As you can see, operator+ has not been replaced by concatenation in the second case (created for literal with subsequent run-time addition). The compiler simply cannot cut it out because the programmer has too many possibilities, which greatly limits the scope of optimization. This is not MKL, of course, it may be different, but the very statement: "a normal compiler will do everything for me" is wrong.This is not MQL, of course, it may be different, but the statement "a normal compiler will do everything for me" is erroneous.
Tired of wasting time and money: the optimiser hangs on the last pass. Agents do nothing, everything is at Authorized stage. There is silence in the log. It makes no sense to enable/disable agents, everything starts from scratch after optimization is restarted.
Who has faced this problem? How to fight it?
Magic line
Sequence of operations in MetaEditor\1495 at a screen resolution of 1024x768 :
- Open the attached file
- Move the horizontal scroll slider all the way to the right (as in the picture)
- In the 3rd line click on /*12345*/
Further settings: Service/Settings/General/Tabulation 4 charactersWhen attempting to convert a string into a number using StringToInteger(), if the string does not contain a number, it returns 0 without an error (GetLastError() = 0). If the input parameters contain a string and the user specified the values incorrectly - the function will return an incorrect value and no error. This is bad.
Further, if the string contains an incorrect number representation, for instance, 5o (instead of 50), the function will return the value 5 without generating an error. Not only that it is not 0, but the function breaks the string as 5, which is again incorrect.
Please, dear developers, improve the function adding error codes or if it cannot parse the string, return LONG_MAX value + error so that we may determine what is wrong. You cannot do it now.
Checking script code:
#property script_show_inputs
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
input string value="05";
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
const long iValue=StringToInteger(value);
Print("iValue = ",iValue,", lastError = ",GetLastError());
}
//+------------------------------------------------------------------+
Implement your own version of the function - it should take no more than 10 minutes.
We will not change the behaviour of the system functions.
Implement your own version of the function - it should take no more than 10 minutes.
We will not change the behaviour of the system functions.
So you don't think it is necessary to refine functions, especially functions that can obviously lie?
Even if we just added error codes, it would be Ok, but now you are suggesting that we reinvent the wheel. Not a complicated one, of course, but a bicycle.
So you don't think it's necessary to refine functions, especially functions that can obviously lie?
Even if you just added error codes, it would be good, but now you are proposing to reinvent the wheel. Not a complicated one, of course, but a bicycle.
Compilation error
struct S {};