//+------------------------------------------------------------------+//| Template for getting the value |//+------------------------------------------------------------------+template<typename T>
T CGlobalVar::Value(void)
{
return (T)this.m_value;
}
The compiler doesn't complain when compiling the definition file.
Then I call this method in the script:
int nRes=gVar1.Value();
I get an error "could not deduce template argument #0".
The compiler doesn't complain when compiling the definition file.
Then I call this method in the script:
I get an error "could not deduce template argument #0".
Unfortunately, in MQL you can typecode a function only by parameters, because you cannot explicitly specify the required type, unlike in C++.
int nRes=gVal1.Value<int>();
This limitation can be circumvented by adding a fake parameter:
//+------------------------------------------------------------------+//| Template for getting the value |//+------------------------------------------------------------------+template<typename T>
T CGlobalVar::Value(T)
{
return (T)this.m_value;
}
int nRes=gVar1.Value((int)0);
The error is that the compiler does not specify where it occurs(__FILE__, __LINE__) and there is no transition as with most errors, making it difficult to find and fix
#1085286 with a similar problem. In multiple orders, clearly not related to any particular one.
Already corrected it, thanks.
An update will be available in a few minutes.
Already corrected, thank you.
An update will be available in a few minutes.
Yeah, it's working,
but why does the picturedownloadas a file and not open in the browser like it did 2 days ago??? Or is it something wrong with me?
standard script - "perion_converter_new" loads the kernel 100%
This is normal - the lag is unbelievable. 723 build
I haven't seen it create such problems.
Now, in 725 - same (not noticed in creating problems).
You didn't correct its code yourself?
P./S.: Assuming these posts can be deleted now. Since the forum is on MT5.
I wonder if I'm the only one left with a single English in the localisation list after upgrading MT5 to 991?
This is a question for OOP experts.
There is a class. It has this template method:
The compiler doesn't complain when compiling the definition file.
Then I call this method in the script:
int nRes=gVar1.Value();I get an error "could not deduce template argument #0".
This is a question for OOP experts.
There is a class. It has this template method:
The compiler doesn't complain when compiling the definition file.
Then I call this method in the script:
I get an error "could not deduce template argument #0".
Compilation error ##
but otherwise
fine. What's the difference?Abstract compilation error: code generation error