This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tr1::hashtable iterators


Hi.

Trying to compile the following with either SuSE's 4.0.2 or SVN trunk
rev. 113521

=======================================

std::tr1::unordered_map<int,int>::iterator it;

=======================================

I found that the Internal::hastable_iterator and Internal::hashtable_const_iterator don't have default ctors which seems strange to me. I couldn't find a PR about this issue.

The proposal n1456 only says that the iterators have to be forward iterators. I don't know whether forward iterators have to be default constructible but it seems unexpected to me if they don't.

I'm not sure whether this is the correct fix, but adding

hashtable_iterator()
: hashtable_iterator_base<Value, cache>(0, 0) { }

and the same for hashtable_const_iterator seems to work for me, i.e. it compiles. I haven't done any further testing, yet.

Should I file a PR about this or is the current behavior correct?


Best regards, Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]