Using std::bitset with boost::assign::assign_map_list_of
Hi: How can I assign a std::bitset to the first parameter (key) of a map using boost::assign::assign_map_list_of, do I have to construct a bitset or can I use one on the fly? In want to be able to say: Map =boost::assign::Assign_Map_list_of(bitset, int); How can I do this for multiple values? Sean. __________ Information from ESET NOD32 Antivirus, version of virus signature database 3228 (20080630) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Sean Farrow skrev:
Hi: How can I assign a std::bitset to the first parameter (key) of a map using boost::assign::assign_map_list_of, do I have to construct a bitset or can I use one on the fly? In want to be able to say: Map =boost::assign::Assign_Map_list_of(bitset, int); How can I do this for multiple values?
Does map = map_list_of( "01010", 1 )( "10010", 42 ) not work? -Thorsten
Hi: I'll check this tommoro, if this works is the msb the first bit, i.e in the first example 1? So if I wanted to set a 6-bit bitset to 1 it would be 000001 I don't want to have to go through, printing all 63 values if I can help it! Sean. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Thorsten Ottosen Sent: 30 June 2008 20:44 To: boost-users@lists.boost.org Subject: [BULK] Re: [Boost-users] Using std::bitset with boost::assign::assign_map_list_of Importance: Low Sean Farrow skrev:
Hi: How can I assign a std::bitset to the first parameter (key) of a map using boost::assign::assign_map_list_of, do I have to construct a bitset or can I use one on the fly? In want to be able to say: Map =boost::assign::Assign_Map_list_of(bitset, int); How can I do this
for multiple values?
Does map = map_list_of( "01010", 1 )( "10010", 42 ) not work? -Thorsten _______________________________________________ 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 3228 (20080630) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3229 (20080630) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3229 (20080630) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Sean Farrow skrev:
Hi: I'll check this tommoro, if this works is the msb the first bit, i.e in the first example 1? So if I wanted to set a 6-bit bitset to 1 it would be 000001 I don't want to have to go through, printing all 63 values if I can help it!
then use ints instead of strings to construct the bitset. -Thorsten
Hi: Ok, how do I calculate the integers to use, is it binary--I assume soso for example if I wanted bits 1 and 6 set the integer would be 65, if I'm wrong please get me on the straight and narrow! Sean. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Thorsten Ottosen Sent: 01 July 2008 10:26 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [BULK] Re: Using std::bitset withboost::assign::assign_map_list_of Sean Farrow skrev:
Hi: I'll check this tommoro, if this works is the msb the first bit, i.e in the first example 1? So if I wanted to set a 6-bit bitset to 1 it would be 000001 I don't want to have to go through, printing all 63 values if I can help it!
then use ints instead of strings to construct the bitset. -Thorsten _______________________________________________ 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 3230 (20080701) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3230 (20080701) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
participants (2)
-
Sean Farrow
-
Thorsten Ottosen