what do these do ?

 
__inline
__forceinline
tx
 
Lorentzos Roussos:
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. 

 
Yashar Seyyedin #:

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);
  }
 
Lorentzos Roussos: tx

They have no effect in MQL5 at the moment. They are just there to reserve the words, nothing else.

MetaTrader 5 Platform Beta Build 1910: Unbound drag-and-drop of charts and .Net libraries in MQL5 - New Metatrader 5 platform to be released on October 14, 2018

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.
 
Fernando Carreiro #:

They have no effect in MQL5 at the moment. They are just there to reserve the words, nothing else.

MetaTrader 5 Platform Beta Build 1910: Unbound drag-and-drop of charts and .Net libraries in MQL5 - New Metatrader 5 platform to be released on October 14, 2018

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

 
Lorentzos Roussos #: Ow , thanks
You are welcome!
 
Lorentzos Roussos #:

Hmm , i don't seem to be getting it . Thanks for your explanation  🙏

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.

 
Yashar Seyyedin #:

In your example the compiler output is:

It means, replaces the function call with function body. 

Good to know it doesn't perform anything in MQL.

Okay , i see . I just could not wrap my head around its use .

Thank you