tx
I havent coded C++ for years. But inline is a compiler directive(used in function definition) to force it to replace all function calls with the function body. This reduces overheads of function calls like parameter passing etc.
I havent coded C++ for years. But inline is a compiler directive(used in function definition) to force it to replace all function calls with the function body. This reduces overheads of function calls like parameter passing etc.
Hmm , i don't seem to be getting it . Thanks for your explanation 🙏
__forceinline void summer(){ sum=a+b; } int OnInit() { //--- create timer int a=5,b=6,sum=0; __forceinline summer(); //--- return(INIT_SUCCEEDED); }
They have no effect in MQL5 at the moment. They are just there to reserve the words, nothing else.
10. MQL5: Added support for inline, __inline and __forceinline specifiers when parsing code. The presence of the specifiers in the code causes no errors and does not affect the compilation. At the moment, this feature simplifies transferring С++ code to MQL5.
Find more information about specifiers in MSDN.
They have no effect in MQL5 at the moment. They are just there to reserve the words, nothing else.
10. MQL5: Added support for inline, __inline and __forceinline specifiers when parsing code. The presence of the specifiers in the code causes no errors and does not affect the compilation. At the moment, this feature simplifies transferring С++ code to MQL5.
Find more information about specifiers in MSDN.
Ow , thanks
In your example the compiler output is:
int OnInit() { //--- create timer int a=5,b=6,sum=0; sum=a+b //--- return(INIT_SUCCEEDED); }
It means, replaces the function call with function body.
Good to know it doesn't perform anything in MQL.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use