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 8934389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:46:34+00:00 2026-06-15T09:46:34+00:00

When compiling a Visual C++ project with the optimization option /Ob1, only functions with

  • 0

When compiling a Visual C++ project with the optimization option /Ob1, only functions with the keywords __inline / inline or those who are defined inside a class defintion get inlined (and even then not necessarily, but only if the compiler sees it fit).

My question is, is it possible to tell the compiler (under visual C++) to inline only functions that are defined inline with the inline keyword and not to inline methods defined inside class definitions, under /Ob1 optimization option?

Does the g++ compiler do the same as the /Ob1 option on Windows (let’s say, under the g++ -O3 option), does it inline member methods defined inside a class defintion? If yes, is there a way to tell it to inline only functions outside class definitions that carry the inline keyword?

  • 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-15T09:46:36+00:00Added an answer on June 15, 2026 at 9:46 am

    The C++ standard (§ 7.1.2/3) specifies that functions that are defined inside the class definition are implicitly declared inline, basically because they need to be, to not disobey the One Definition Rule. So what you are asking for is basically an option to not inline functions that are declared inline (implicitly).
    If you don’t want a function to be declared inline (for whatever reason), you should not define it in the class definition.

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

Sidebar

Related Questions

I have a .NET project that I've been compiling with Visual Studio and running
I'm compiling a 64 bit c++ project on visual studio pro 2010 and I'm
I have a c# (win form) visual studio project which i am now compiling
I have the following warnings while compiling an openFrameworks 007 project on Visual Studio
When compiling a project in Visual Studio, the error message the exec task needs
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs
I have the ActiveMQ-CPP 2.2.1 Visual Studio 2005 project compiling and running. In the
I am compiling project in Visual Studio 10, compiled executable runs fine on win
I am compiling a project in Visual C++ 2010, but I have problems with
I'm having a strange issue compiling and old C++ Visual Studio 5 project in

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.