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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:20:56+00:00 2026-06-12T09:20:56+00:00

Possible Duplicate: When should I write the keyword 'inline' for a function/method? I am

  • 0

Possible Duplicate:
When should I write the keyword 'inline' for a function/method?

I am not 100% sure, but as far as I know, if I declare a function on an hpp file with the body it will be treated as it is marked as inline(the compiler will decide what to do), I mean:

//myfile.hpp
class StackOverflow{
public:
    void overflow(){_overflow = true;}
...
}

would be the same than:

//myfile.hpp
class StackOverflow{
public:
    ***inline*** void overflow(){_overflow = true;}
...
}

If I am wrong then the question is over, but otherwise, I really like to mark as inline a function even it is not necessary, does general code style guidelines say soemthing about it?

Thanks so much

  • 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-12T09:20:57+00:00Added an answer on June 12, 2026 at 9:20 am

    As the mention of the keyword inline in this context gives no information whatsoever, leave it out. It’s simply visual clutter.

    If there were an option to make an inline-defined function non-inline, this would be a different matter (consider private-by-default as such an example): here, it could be argued that even though it’s the default, making the choice explicit makes it easier to understand. But there’s no choice here. No matter what you do, a member function defined inside the body of a class is inline.

    In fact, marking it explicitly as inline would be akin to providing other inferred information. You wouldn’t write the following, would you?

    #define member
    #define function
    
    class StackOverflow{
    public:
        member function inline void overflow() { _overflow = true; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Hash Function .NET hi, I should write an app that take string
Possible Duplicate: Should I use != or <> for not equal in TSQL? Behavior
Possible Duplicate: Should ‘else’ be kept or dropped in cases where it’s not needed?
Possible Duplicate: Does anyone beside me just NOT get ASP.NET MVC? I dont know
Possible Duplicate: Should I document my private methods? Is it good practice write comment
Possible Duplicate: How to write a:hover in inline CSS? I need to generate some
Possible Duplicate: Linq to SQL “not like” operator How can I write a dynamic
Possible Duplicate: Write a function that returns the longest palindrome in a given string
Possible Duplicate: Write a function that returns the longest palindrome in a given string
Possible Duplicate: Should Usings be inside or outside the namespace sa1200 All using directives

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.