Accessing an element of multi_index_container using iterator_to

First of all, i'm a programmer with no much experience using Boost
Libraries.
I'm using Boost for academic purposes and here's my problem.
I simply want to access an element of a multi_index_container, by using the
iterator_to iterator.
the container has entries that are
word_index;*
word_index word_set; int word_count_id = 1;
From main, I insert some "entries" like below. *This a test main* *int main(void){
//insert to word_set
pair

2010/2/22 Andrew Kokkalis
Declaration of my container is below: struct counterpart { string word; int id; float tf_idf;
counterpart(string word_, int id_) {
Prefer an initializer list: counterpart(string word, int id) : word(word), id(id), tf_idf(0.0) {}
};
typedef multi_index_container< counterpart, indexed_by< ordered_unique< tag
, BOOST_MULTI_INDEX_MEMBER(counterpart, string, word)>, ordered_unique< tag , BOOST_MULTI_INDEX_MEMBER(counterpart, int, id)>, ordered_non_unique< tag , BOOST_MULTI_INDEX_MEMBER(counterpart, float, tf_idf)> > word_index;
word_index word_set;
Each index of word_index acts/behaves like the corresponding STL
container, and word_index "derives" from its first index so also
behaves like it.
So to search by word (first index), simply do a word_set.find() with a string.
To search by any index, first get a *reference* to that index, e.g.
word_set.get
participants (2)
-
Andrew Kokkalis
-
Dominique Devienne