Re: [Boost-users] Changing from std::map to boost::bimap
Hi: I got that far, however I carn't seem to declare iterators properly: With the previously used map scheme, my iterator was declared as follows: Std::map<std::bitset<6>, int>::iterator DotsIterator; How do I convert this to use boost::bimap. Cheers Sean. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Daryle Walker Sent: 01 September 2008 20:34 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Changing from std::map to boost::bimap On Aug 31, 2008, at 6:56 AM, Sean Farrow wrote:
I am looking to change from std::map to boost::bimap. I have the following defined: std::bimap<std::bitset<6>, int, BitSetComp> DotsList; And boost::bimap<std::bitset<6>, int, BitSetComp>::iterator DotsIterator; [SNIP] How do I change these definitions to use boost::bimap. Any help appreciated.
A bimap can act as two regular maps, and does so through two special public data members. The "left" member acts like a map<bitset, int, BitSetComp>, and the "right" member flips the first two arguments. There are also type-aliases defined for each iterator, left or right. There is also a mode that acts like a std::set< std::pair< std::bitset< 6 >, int > > >. Read the docs for the specific names and modes. -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users __________ Information from ESET NOD32 Antivirus, version of virus signature database 3406 (20080902) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3406 (20080902) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
On Sep 2, 2008, at 2:22 AM, Sean Farrow wrote:
Hi: I got that far, however I carn't seem to declare iterators properly: With the previously used map scheme, my iterator was declared as follows: Std::map<std::bitset<6>, int>::iterator DotsIterator; How do I convert this to use boost::bimap. [TRUNCATE]
Did you read the docs? There should be somethings like "left_iterator" and "right_iterator" (and the set-mode iterator and "const" variants). Use whichever of those as appropriate. -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
participants (2)
-
Daryle Walker
-
Sean Farrow