Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MSVC 2K5 - Difference between inline and intrinsic?

Posted on 2006-11-12
3
Medium Priority
?
263 Views
Last Modified: 2008-02-01
Hi,

What's the difference between inline and intrinsic functions? From what I can tell they both seem to instead copy the function contents to where it would be called to prevent function call overhead?

Thanks,
Uni
0
Comment
Question by:Unimatrix_001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 17925636
There is none, see http://msdn2.microsoft.com/en-us/library/tzkfha43.aspx ("instrinsic"):

The intrinsic pragma tells the compiler that a function has known behavior. The compiler may call the function and not replace the function call with *inline* instructions, if it will result in better performance.
0
 
LVL 86

Accepted Solution

by:
jkr earned 1000 total points
ID: 17925671
BTW, see also http://en.wikipedia.org/wiki/Intrinsic_function for one subtle difference

"Unlike an inline function though, the compiler has an intimate knowledge of the intrinsic function and can therefore better integrate it and optimize it for the situation."
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 17925705
Thank you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question