Jump to content



Photo

inline functions C++


  • Please log in to reply
6 replies to this topic

#1 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,864 posts

Posted 25 July 2012 - 03:53 PM

I think I get the idea of why you might use an inline function.
From what I read, if you are calling a function many times throughout your
code, it may be beneficial to have that function inline.

My question is, will making a function inline, benefit my code if it is only used once
but many times in a tight loop?

I also read that long complex functions are not good candidates for inline, but I'm unsure
if that was opinion or factt.

Anyway, the function is neither long nor complicated, but called in something similar to a msg loop.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)





#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 25 July 2012 - 04:14 PM

It can benefit yes. The compiler may already inline the code or may not even if you tell it to. The inline keyword is a hint that the compiler may not need or may ignore entirely.
  • JScript likes this

#3 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 25 July 2012 - 05:45 PM

I liked the idea, it can be much easier than inline assembly!

But I think the trend is to have a real AutoIt compiler, where at least the script is converted into C and after that, compiled!
I bet all the chips in AutoIt, no doubt! 
João Carlos.

Edited by JScript, 25 July 2012 - 05:45 PM.

http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#4 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,191 posts

Posted 25 July 2012 - 05:47 PM

JScript this is not about AutoIt.

eMyvnE


#5 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 25 July 2012 - 05:52 PM

JScript this is not about AutoIt.

:oops:
I'm sorry, at least I expressed my opinion, even that is not valid! 
João Carlos.
http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#6 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,191 posts

Posted 25 July 2012 - 05:59 PM

:oops:
I'm sorry, at least I expressed my opinion, even that is not valid! 
João Carlos.

Don't worry about it. We all say stupid things once in a while.

eMyvnE


#7 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,864 posts

Posted 25 July 2012 - 06:19 PM

It can benefit yes. The compiler may already inline the code or may not even if you tell it to. The inline keyword is a hint that the compiler may not need or may ignore entirely.


Thank you.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users