|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-11-07 15:36:35
"Jonathan Turkanis" <technews_at_[hidden]> wrote in message
news:cmlpo2$p7t$1_at_sea.gmane.org...
|
| "Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
| news:cmlnb5$j8s$1_at_sea.gmane.org...
| > "Jonathan Turkanis" <technews_at_[hidden]> wrote in message
| > news:cmlj0d$8o9$1_at_sea.gmane.org...
| >
| >
| > | BTW, I used the Assign library in the examples and regression tests, and
I
| > don't
| > | think I could have done without it. Thanks!
| >
| > you're welcome. A small nitpick:
| >
| >
| > list_of( pair_type("Sofa", "Living Room") )
| > ( pair_type("Stove", "Kitchen") )
| > can be done as list_of<pair_type>( "Sofa", "Living Room")( "Stove",
| > "Kitchen")
| > -Thorsten
|
| Thanks. So
|
| // pseudocode initialization
| vector< list< pair<string, string> > > test =
| { { { "London", "England"}, { "Paris", "France"} },
| { { "Sofa", "Living Room"}, { "Stove", "Kitchen"} },
| { { "Brain", "Skull"}, { "Appendix", "Abdomen"} } };
|
| translates to
|
| typedef pair<string, string> pair_type;
| typedef list<pair_type> list_type;
|
| vector< pair<string, string> > test =
| list_of<list_type>(
| list_of<pair_type>("London", "England")
| ("Paris", "France")
| )
| (
| list_of<pair_type>("Sofa", "Living Room")
| ("Stove", "Kitchen")
| )
| (
| list_of<pair_type>("Brain", "Skull")
| ("Appendix", "Abdomen")
| );
|
| ?
well, yes. If everything worked as I would expect for a conforming
implementation, you can even say
= list_of( map_list_of( "London", Englang" )( "Sofa", "Living Room" ) )
( map_list_of( ... ) );
but, as said, g++ and/or g++'s standard library has problems...either in pair
or iterator range constructors.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk