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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:07:37+00:00 2026-06-12T22:07:37+00:00

So I just went over cascading member functions calls by returning the *this pointer.

  • 0

So I just went over cascading member functions calls by returning the *this pointer. I get how it works mechanically but it looks like a large time investment in implementing the functions for gaining the minor ability to one line chain function calls using the dot operator. I’m sure there must be some other benefit beyond simply shortening member function calls but there really isn’t much information about this subject. The first couple pages of google only came up with instructions on how to implement cascaded function calls and nothing about why, how, or where this technique might be useful. Anyone have some useful links that might cover the subject more indepth? 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-12T22:07:38+00:00Added an answer on June 12, 2026 at 10:07 pm

    The benefit is better-looking code for users of the class when chaining of the operations makes sense. For example:

     rect.left( 10 ).top( 5 ).right( 50 ).bottom( 40 );
    

    That may be better to read than either:

     // longer code
     rect.left( 10 );
     rect.top( 5 );
     rect.right( 50 );
     rect.bottom( 40 );
    

    Or:

     // reader should remember order of parameters
     rect.move_to( 10, 5, 50, 40 ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wrote this into my WebForms .aspx: <span id=GenerateChartButton runat=server></span> I went to
I've just had a crash course of Cassandra over the last week and went
Okay, something just went crazy. Unless China is taking over starting with my test
I went over many examples of this method and still cant figure out whats
I was just reading up a lecture which breifly went over Container Interface. I
Ive been going over this for a couple days and i just cant find
I just went through writing a fairly lengthly application in c++ using mingw and
I just went through trying to make an alarm clock app with local notifications
I just went through a bunch of stuff trying to figure out how to
Just as the title says. As i went through different explanations for choices made

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.