Errors, bugs, questions - page 2869
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
You have a syntax error - give an example of working code with (typename) in brackets. You might as well write (OnStart) in brackets
Well, there is no syntax error
typename(J)
But do you already consider this code a syntax error?
(typename)J
When a type conversion principle is supposed to work here, and Help allows both variants.
Like this, there's no syntax error.
Does this count as a syntax error?
When the principle of type conversion is supposed to work here, and the help allows for both.
typename is not a type, it is a keyword. In this case, the type is T. The conversion is to a type, not to the keyword.
The philosophical justification is not appropriate here. Although if MQL were an abstract language, we could probably resort to casting to the keyword and it would move up to the 1st place in the ranking
typename is not a type, it is a keyword. In this case, the type is T. The conversion is to a type, not to a keyword
Philosophical justification is not appropriate here. Although, if MQL were an abstract language, we could probably cast it to the keyword, and it would move up to the 1st place in the rating
I understand that typename is not a type.
But in this case, we're getting a transformation.
We obtain its type from a constant.
Maybethis is not correct in syntax? But it works.
#define A '+' typename(A)
I understand that typename is not a type.
But in this case, we get a transformation.
From a constant, we get its type.
Maybethis is not the right syntax? But it works.
It works, but not the way you think it will. You do not get a type but a string. I wanted to show you this by example, but I got an error below.
But it doesn't mean that you're right - just another error of the compiler.
What is the difference between (1) and (2) ? Dear developers - maybe Roman is right and now typename returns type?
The result was expected: string
It works, but not in the way you imagine. You do not get a type, but a string. I wanted to show it with an example, but I got an error:
How it is not a type?
It is a type, not a string.
ushort is not a string.
How is it not a type?
Just getting a type, not a string.
Ushort is not a string.
You do not get ushort, but "ushort". Do you understand the difference? If not, read the documentation before understanding.
Although it would be cool to get a real ushort!
You do not get ushort, but "ushort". Do you understand the difference? If not, read the documentation to understand
So Print() already prints it as "ushort" with a string literal.
What does it have to do with it? The very fact that typename returns a type name!
So this already prints Print() as "ushort" string literal.
What does that have to do with it? The very fact that typename returns a type name!
Have you read the documentation at the link? There is an example there, too. Unfortunately, my example failed.
Have you read the documentation on the link?
What does it have to do with templates?
If the usage syntax is not for a template, in this case.