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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:01:09+00:00 2026-06-08T00:01:09+00:00

In the example pointers/countingptr.hpp of the book C++ Templates – The Complete Guide members

  • 0

In the example pointers/countingptr.hpp of the book C++ Templates – The Complete Guide members of the derived dependent class CountingPtr are referred to using the this pointer. Why is this necessary in this example?

I’m aware that the this pointer is required in order to name members of a dependent base class template. Surely the this pointer is not required in dependent derived class template also?

  • 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-08T00:01:11+00:00Added an answer on June 8, 2026 at 12:01 am

    I believe it’s just a style of the guy who was making this code. Some people prefer putting this-> in front of anything that is related to a class inside that class. That indeed may sometimes be useful if you are doing funny things like:

    void foo( int a )
    {
    this->a = a;
    }
    

    or if you just think this increases readability.
    However, if you use it too much, it will be a mess:

    this->a = this->b * this->c - this->foo( this->d, this->bar() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if I have for example some class Base and derived from it Derived Also
I saw the following example in book of the C++ Programming Language class Ptr
I'm wondering if anyone can give me a good example of using pointers in
I always think of having to use pointers for polymorphism. Using the canonical example:
Can I Allocate a specitic memory address using pointers in c++ ? For example:
Are array of pointers to different types possible in c++? with example please)
Example Div: <div class=container> <div class=select1></div> <div class=select2></div> <div class=select3></div> </div> Now I want
here is example how Pointers are used to store and manage the addresses of
we know meaning of pointers for example to get location of variable int t=9;
I would like to synchronize two object headers with pointers. For example: I know

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.