------- Additional Comments From chris at bubblescope dot net 2005-09-07 20:06 ------- You are right, I previously didn't think it was possible without adding some more template parameters. However, I should have known there is nothing you can't do with a few templates :)
How about something like: template<typename _Iter> inline __normal_iterator(const __normal_iterator<_Iter, _Container>& __i, typename std::__enable_if<int, std::tr1::is_convertible<_Iter, _Iterator>::value>::__type = 0) : _M_current(__i.base()) { } Which shouldn't effect any existing code, as unless _Iter is convertable to _Iterator, _M_current(__i.base ()) isn't going to compile. I'm adding #include<cpp_type_traits.h> #include<tr1/type_traits> to do this, and of course I imagine we'll have to cut is_convertable out of type_traits... I haven't done a full test of this yet, but it seems reasonable at first glance. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23767