c++ - How to declare a template method of a template base class using 'using'? -


two methods accessing template base class members described here. when base class member template, accessing using first method (this->) above described here. there way use second method (using xxxx) in scenario well?

for example, in code below, possible replace "????" make code work?

using namespace std;  template<typename t> class base { public:     template<bool good> void foo()     {         cout << "base::foo<" << boolalpha << << ">()" << endl;     } };  template<typename t> class derived : public base<t> { public:     using ????     void bar()     {         foo<true>();     }  }; 

just record, though not provide answer or workaround, working vs express 2013, , can assure that

#include <iostream>  template<typename t> class base { public:     template<bool good> void foo()     {         std::cout << "base::foo<" << << ">()" << std::endl;     } };  template<typename t> class derived : public base<t> { public:      void bar()     {         foo<true>();     } };  struct a{};  void main() {      derived<a> a;     a.bar(); } 

works fine...


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -