Compiles in Commandline-Mode but not from Editor (template/typename T)
Doerk Hilger:
This piece of code is rejected when I compile from the editor
This piece of code is rejected when I compile from the editor
No compilation errors from metaeditor for the code you posted.

The way out seems to be
#ifdef __MQL5__ public: template<typename T> T Get(int index, T defaultvalue=(T)NULL) #else public: template<typename T> T Get(int index, T defaultvalue=NULL) #endif { /... if (index < 0 || index >= cnt_elements) return defaultvalue; return (T)data[index]; }... but that still does not explain, why the compiler fails when started from editor, and the code looks less proper/safe too.
Hi,
phenomenon. This piece of code is rejected when I compile from the editor, but not when its compiled via commandline.
Editor compiler reports: "T" unexpected token for the first line.
Any ideas?