Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:58:56+00:00 2026-05-23T13:58:56+00:00

Im studying inline functions in C++ and have come to a section concerning limitations

  • 0

Im studying inline functions in C++ and have come to a section concerning limitations of its use. It says:

The compiler also cannot perform
inlining if the address of the
function is taken implicitly or
explicitly.

Can someone explain to me, perhaps with an example of some sort, what exactly this means?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:58:56+00:00Added an answer on May 23, 2026 at 1:58 pm

    There are two somewhat separate decisions the compiler makes concerning function inlining:

    • whether a particular function call is inlined;
    • whether a non-inline version of the function exists.

    The first is decided by the compiler on a case-by-case basis, if inlining is possible at that point. It won’t be possible if the function is virtual, or called through a function pointer, and it can’t determine at compile time which function is to be called. It won’t be possible if the definition is not available to the compiler, perhaps because it is defined in a different translation unit and the compiler does not do “whole program optimisation”. The decision may, or may not, be influenced by whether the function is declared inline, and other factors such as its size and how often it is called.

    The second depends on whether a non-inline version is required. It will be required if any call to it is not inlined. It will also (as per your quotation) be required if anything needs the address of the function, as then it must have an address. This can happen either directly (for example by assigning the address to a function pointer), or indirectly (for example, virtual functions will need their address stored somewhere to look up at runtime according to the object’s dynamic type).

    The existence of the non-inline version will not prevent any particular call to the function from being inlined, although it’s possible that it might influence the compiler’s decision, particularly if it’s configured to optimise for code size.

    To summarise, your quotation is simplistic and not entirely accurate; the compiler can still “perform inlining” if the address is taken, it just can’t omit the non-inline version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my adventures studying the boost libraries, I've come across function signatures that have
I have been studying the modalforms & inline formsets but am not able to
Studying compilers course, I am left wondering why use registers at all. It is
While studying about JMX, I have seen one of the important feature of it
In studying actionscript 3's graphics class, I've come across the undocumented drawRoundRectComplex() method. It's
After studying TCP/UDP difference all week, I just can't decide which to use. I
Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better,
While studying C# in ASP.net I have trouble understanding several classes. In which scenario
Studying STL I have tried to negate a functor with not2 but encontered problems.
I am studying to use MVVM pattern for my Silverlight application. Following code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.