Quantcast
Channel: Why do I have to access template base class members through the this pointer? - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by Steve Jessop for Why do I have to access template base class...

Short answer: in order to make x a dependent name, so that lookup is deferred until the template parameter is known.Long answer: when a compiler sees a template, it is supposed to perform certain...

View Article



Answer by Ali for Why do I have to access template base class members through...

(Original answer from Jan 10, 2011)I think I have found the answer: GCC issue: using a member of a base class that depends on a template argument.The answer is not specific to gcc. Update: In response...

View Article

Answer by chrisaycock for Why do I have to access template base class members...

The x is hidden during the inheritance. You can unhide via:template <typename T>class derived : public base<T> {public: using base<T>::x; // added "using" statement int f() { return...

View Article

Why do I have to access template base class members through the this pointer?

If the classes below were not templates I could simply have x in the derived class. However, with the code below, I have to use this->x. Why?template <typename T>class base {protected: int...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images