problem with multi_index_container -> find
Hello,
I don't understand why this code doesn't compile (gcc-3.3.1) '...
id_index.find( id) ...' ?
Regards,
Oliver
#include <iostream>
#include <string>
#include <utility>
#include
phonebook;
void test_multi_index()
{
phonebook pb;
phonebook::nth_index< 0 >::type & name_index = pb.get< 0 >();
std::string family_name("Mann");
std::string given_name("Thomas");
std::pair<
phonebook::iterator,
phonebook::iterator
> p = name_index.equal_range(
boost::make_tuple(
family_name,
given_name) );
while ( p.first != p.second)
{
std::cout << p.first->family_name << ", " <<
p.first->given_name << std::endl;
++p.first;
}
phonebook::nth_index< 1 >::type & id_index = pb.get< 1 >();
int id = 1;
phonebook::iterator itr = id_index.find( id); // <<== doesn't
// error: conversion from `
boost::multi_index::detail::index_iterator
participants (1)
-
Oliver.Kowalke@infineon.com