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

  • SEARCH
  • Home
  • 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 8830231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:01:35+00:00 2026-06-14T08:01:35+00:00

I have read in my document say about inline function. My document says that:

  • 0

I have read in my document say about inline function. My document says that: there are two types of inline function: implicity function and explicity function.

Explicity function: you use inline keyword before function, and using outside of the class. for example:

inline int Math::add(int a, int b){ return a + b; }

Implicity function: every method inside class is implicity. for example:

class Math {
   int add(int a, int b) { return a + b;}   // implicity inline function
};

So, if this true, so, every method that I don’t want to use inline, I must declare outside of the class, right ? And if this true, can I implement a method inside class and don’t want inline function.

Thanks 🙂

  • 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-06-14T08:01:37+00:00Added an answer on June 14, 2026 at 8:01 am

    The only way to guarantee that it is not inline is to make it unreachable at compilation time, for instance, by putting its body definition into cpp file instead of header.

    UPDATE: A commenter says that even putting function body into different compilation unit is not guaranteed to help. He is absolutely right. Usually it helps, but some compilers still may inline the function. So, there is no reliable way to disable inlining that is not compiler-dependent.

    All the inlining is just a question of optimization. If appropriate optimization is on, by writing an inline keyword you just tell the compiler that you RECOMMEND to inline the function. You can neither force compiler to inline a function, nor force compiler not to inline it. For certain compilers, e.g. VC++, there are ways to do so (__declspec(noinline)), but they all are compiler-dependent.

    And why do you need to disable inlining? The compiler often knows better… If it is for debugging purposes, just disable the optimizations, or at least function inlining. You may even use pragmas to do so in a single file. Anyway, debugging a release version should usually be avoided, though sometimes it is impossible to avoid it, of course.

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

Sidebar

Related Questions

I have read a document that they say: In java there two types of
I have read the ARM document about Cortex-M3 (or M0) and it say it
I have read the document Authentication (official from Facebook). I still don't understand the
I have an type of document which users should not be able to read
I have read many answers to questions about dynamically resizing NSWindows and nothing has
I have read few articles about table partioning but still I am bit confused
I've spent two days on this and have gotten nowhere. I'm trying to use
So, let say I have this: var d = document.createElement('div'); d.id = whatever;` So,
I have a servlet that users post a XML file to. I read that
say I have <div id=searchform> <div style=float:right> <a href=~>Advanced Search</a> </div> <div id=resultStats> About

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.