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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:36:41+00:00 2026-05-15T07:36:41+00:00

public: inline int GetValue() const { return m_nValue; } inline void SetValue(int nNewValue) {

  • 0
public:
     inline int GetValue() const {
          return m_nValue;
     }
     inline void SetValue(int nNewValue) {
          this -> m_nValue = nNewValue;
     }

On Learn C++, they said it would run faster. So, I thought it would be great to use on getters and setters. But maybe, there are some drawbacks to it?

  • 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-15T07:36:42+00:00Added an answer on May 15, 2026 at 7:36 am

    I don’t inline anything until a profiler has specifically told me that not inlining is resulting in a performance problem.

    The C++ compiler is very smart and will almost certainly automatically inline such simple function like this for you. And typically it’s smarter than you are and will do a much better job at determining what should or should not be inlined.

    I would avoid thinking about what to or not to inline and focus on the solution. Adding the inline keyword later (which is not a guarantee of inline BTW) is very easy to do and potential places can be found readily with a profiler.

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

Sidebar

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ideally you'd do both client and server side and never… May 16, 2026 at 10:13 am
  • Editorial Team
    Editorial Team added an answer Use json_decode(): $decoded = json_decode($json_string); $comments = $decoded->data[0]->comments->data; foreach($comments as… May 16, 2026 at 10:13 am
  • Editorial Team
    Editorial Team added an answer That is how permissions work in SQL Server. So you… May 16, 2026 at 10:13 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I defined a class named nth_best_parse this way: class nth_best_parse { public: int traversal;
This is my code: public class RegularPolygon { public int VertexCount; public double SideLength;
Is it preferred to define inline methods like: // math.h class Math { public:
public class EventsType { public event EventHandler> NewEvent; public void SmthHappened(string data) { MyEventArgs<Object>
public static string ProductHelper(this Product p) { // Need to get the DisplayName value
public Envio(int id) { XDocument xml = XDocument.Parse(LoadFromService(id)); ID = xml.Element(envio) .Element(de).Value; De =
I posted this Q to TI's 28xx DSP forum but haven't heard a response
public class Greeter extends MovieClip { public function Greeter() { addEventListener(Event.ADDED_TO_STAGE, go); } private
Given a public SOAP web service and no WSDL, I need to build a
I'm having some trouble creating an object in C++. I create a class called

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.