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

Answer by chrisaycock for Why do I have to access template base class members through the this pointer?

$
0
0

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 x; }};

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>