1 // PR c++/34846 2 3 template<typename, typename> struct __are_same { enum { __value = 0 }; }; 4 template<typename _Tp> struct __are_same<_Tp, _Tp> { enum { __value = 1 }; }; 5 template<typename, bool> struct __enable_if { }; 6 template<typename _Tp> struct __enable_if<_Tp, true> { typedef _Tp __type; }; 7 template<typename _Iterator, typename _Container> class __normal_iterator { 8 public: 9 __normal_iterator(); 10 template<typename _Iter> 11 __normal_iterator( 12 const __normal_iterator<_Iter, typename __enable_if<_Container, 13 (__are_same<_Iter, typename _Container::pointer>::__value) >::__type>& __i) 14 { } 15 }; 16 template<typename _Tp> class vector { 17 public: 18 typedef _Tp* pointer; 19 typedef __normal_iterator<int, vector<_Tp> > iterator; 20 }; 21 void test() { 22 typedef int t; 23 vector<t*>::iterator x; 24 vector<t*>::iterator y = x; 25 } 26