Consider this C++ code :
template
class Step
{
public:
using Session_ptr = boost::shared_ptr;
protected:
Session_pt
Here I give another example with the solutions already given in other answers presented.
std::iterator is a dependent base class of Myterator. In order to lookup there, you'll have to do qualified name lookup.
// std::iterator example from http://www.cplusplus.com/reference/iterator/iterator/
//***************************************************************************************
#include // std::cout
#include // std::iterator, std::input_iterator_tag
template
class MyIterator : public std::iterator
{
// The working alternatives, one per row
//typename std::iterator::pointer p;
//using pointer = typename std::iterator::pointer; pointer p;
//using typename std::iterator::pointer; pointer p;
//using Iter = typename std::iterator; typename Iter::pointer p;
pointer p; // This does not work while any of alternatives in comments above do work
public:
MyIterator(MyType* x) :p(x) {}
MyType& operator*() {return *p;}
};
int main () {
int numbers[]={10,20,30,40,50};
MyIterator from(numbers);
std::cout << *from << ' ';
std::cout << '\n';
return 0;
}