------- Additional Comments From sven at clio dot in-berlin dot de  2005-05-15 
14:43 -------
And for everyone who have the same problem, here is a workaround. Declare a 
template class with a dummy argument (int in this case), partial specialize 
this class and derive from the partial specialized template class. Why? 
Because the standard says so, there is no other reason (in other words, there 
is no reason at all). 
 
--- test.cpp 
 
template<typename _T> 
class wrapper 
{ 
  public: 
    wrapper(): _M_t() {} 
    wrapper(_T t): _M_t(t) {} 
    operator _T& () { return _M_t; } 
  private: 
    _T _M_t; 
}; 
 
struct container 
{ 
  struct pointer {}; 
  struct forward {}; 
  struct backward {}; 
  struct bidirectional {}; 
  struct randomaccess {}; 
}; 
 
template<typename _T> 
struct heap: container 
{ 
    typedef _T value_type; 
    template<typename _U, int _i> struct _iterator; 
  private: 
    // the absolute unnecessary additional template class 
    template<int _i> 
    // partial specialization is allowed 
    struct _iterator<pointer, _i>: wrapper<value_type *> {}; 
  public: 
    template<typename _U> struct iterator: _iterator<_U, 0> {}; 
}; 
 
heap<int>::iterator<heap<int>::pointer> p; 
 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21543

Reply via email to