
Felipe Magno de Almeida ha escrito:
Hi,
I'm having a compiler error with gcc 3.4.4. It compiles cleanly with VC7.1 and gcc4.1. I'm using the CVS version of boost. The code is:
header_decode_type and header_encode_type types dont really matter, are just member variables that are passed to header constructor.
header headers::operator[](std::string const& name) const // line 57 { headers_multi_index_t::nth_index<1>::type const& index = headers_set_.get<1>(); return header(index.equal_range(name) , header_decode_handler_, header_encode_handler_); }
The headers_multi_index_t is:
typedef std::pair<std::string, std::string> pair; typedef mi::multi_index_container<pair , mi::indexed_by < mi::sequenced<> , mi::ordered_non_unique < BOOST_MULTI_INDEX_MEMBER(pair, std::string, first) , iless > >
headers_multi_index_t;
And the header constructor is:
typedef std::pair<iterator, iterator> iterator_pair;
Here. What is this "iterator" type? What index.equal_range(name) returns is a std::pair< headers_multi_index_t::nth_index<1>::type::iterator, headers_multi_index_t::nth_index<1>::type::iterator
where the iterators are not the same type as headers_multi_index_t::iterator; this is explained with more parsimony at http://boost-consulting.com/boost/libs/multi_index/doc/tutorial/basics.html#... Could this be related to the problem, or am I completely misguided? If the latter, a complete testcase reproducing the problem would be of much help. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo