Solved

MSVC 2K5 - Difference between inline and intrinsic?

Posted on 2006-11-12
3
261 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 250 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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

630 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