boost::MultiIndex help

E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm using boost multi index for the first time. I've managed to populate
the container with my data & now I am trying to get the non-unique
ordered index to work. Does anyone have a source example (not from the
boost.multiindex tutorial please) used to get a list, set, whatever, of
tuples from such a search on such an index?

Thanks,
Evan Carew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtDRCpxCQXwV2bJARAiBuAKCIxIcgHh0YVcSuCXkXDFaOuLYiugCgtUlu
ZC3C2hNJgI5R8v9kyU0Ijmg=
=tV0D
-----END PGP SIGNATURE-----
 
M

mlimber

Evan said:
I'm using boost multi index for the first time. I've managed to populate
the container with my data & now I am trying to get the non-unique
ordered index to work. Does anyone have a source example (not from the
boost.multiindex tutorial please) used to get a list, set, whatever, of
tuples from such a search on such an index?

You'll likely get a faster response from the Boost user list. See:

http://boost.org/more/mailing_lists.htm#users

Cheers! --M
 
?

=?iso-8859-1?B?Sm9hcXXtbiBNIEzzcGV6IE118W96?=

Evan Carew ha escrito:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm using boost multi index for the first time. I've managed to populate
the container with my data & now I am trying to get the non-unique
ordered index to work. Does anyone have a source example (not from the
boost.multiindex tutorial please) used to get a list, set, whatever, of
tuples from such a search on such an index?

Hello Evan,

I'd like to help you, but for that I'd need a little more
info. Could you post some of your source code, like
for instance the instantiation of multi_index_container
you've defined? And what are the specific problems you're
having with ordered indices?

Also, this is probably best moved to the Boost users list,
as comp.lang.c++ is in principle not devoted to particular
libs but the C++ language in general.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks, I didn't realize there was a general boost mailing list. I'll
give it a try. I do note tho that there is relatively low traffic on it,
i.e. < 500 / Mo.

Evan
You'll likely get a faster response from the Boost user list. See:

http://boost.org/more/mailing_lists.htm#users

Cheers! --M

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtXTwpxCQXwV2bJARAupjAKC1+BA34JrCIUQ9SVrRWdT38qc4bgCfYkgw
Of08FH9zlAOzGIaanvoFXms=
=Pf1n
-----END PGP SIGNATURE-----
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan said:
Thanks, I didn't realize there was a general boost mailing list. I'll
give it a try. I do note tho that there is relatively low traffic on it,
i.e. < 500 / Mo.

Evan
Hmm... Looks like their list server is down. I am unable to register. <sigh>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZgGpxCQXwV2bJARAu3eAJwPdPeGc1A0s4rDgy+DWhtGnLFjhACgkiPq
V6rbwqzWTHv2yhOE6zTiQO0=
=ertA
-----END PGP SIGNATURE-----
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, lets try this example source code:


typedef multi_index::multi_index_container<
person,
multi_index::indexed_by<
multi_index::eek:rdered_unique<
multi_index::tag<voterid>,
BOOST_MULTI_INDEX_MEMBER(person,unsigned long,voterid)>,
multi_index::eek:rdered_non_unique<

multi_index::tag<lastname>,BOOST_MULTI_INDEX_MEMBER(person,string,lastname)>,
multi_index::eek:rdered_non_unique<
> people_set;

......

int main(){
const people_set::nth_index<2>::type& resstreet_index=ps.get<2>();
pair<people_set::iterator, people_set::iterator> range;
range = resstreet_index.equal_range((*domoItor).first);
}

The above code doesn't compile. If you happen to know why, I'd
appreciate some help in getting it going.

Thanks
Evan Carew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZkEpxCQXwV2bJARAiFyAJ0SlA2q8ls4SQ/jhep7suC8/Fd7hACcCP2E
2lyn3/OmjYl7hKWbZcaqTfM=
=ry4Y
-----END PGP SIGNATURE-----
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan said:
Well, lets try this example source code:


[snip]
int main(){
const people_set::nth_index<2>::type& resstreet_index=ps.get<2>();
pair<people_set::iterator, people_set::iterator> range;
range = resstreet_index.equal_range((*domoItor).first);
}
By changing the pair instance to:

pair<people_set::nth_index<2>::type::iterator,
people_set::nth_index<2>::type::iterator> range;

I finally got it to compile. I managed this not by reading the tutorial
for the library (the information isn't there) but from reading the
rather prodigious code in multi_index. Yuck!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZ4LpxCQXwV2bJARAtFMAJ9BMmLq9uK8vO0EgmfqgRmN4tSMCwCcDzAf
IdDBBDb5CiMaZW6/pMsq9oE=
=iDdA
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top