kinda, sorta, like an iterator for dynamic_bitset, but not really.
I'm currently writing some code for a client where I make extensive use of dynamic_bitsets to determine very quickly which options are appropriate based on a number of criteria. I set up before hand dynamic_bitset for each person, place, and thing which are then bitwise AND'd together to determine where the points of intersection are. What I need is something with an iterator syntax that returns the indexes whose values are set. I could of course just loop through looking for set values, but that seems silly when you think that entire blocks of bits can be skipped if the block has a value of zero. So my questions is, before I set out to write some code, has somebody already done this? It seems like a logical use of dynamic_bit set so it does not seem implausible. If not, any suggestions or warnings? Thanks, Andy
On Tue, 15 Apr 2003 17:49:27 -0400, "Andy Klapper"
What I need is something with an iterator syntax that returns the indexes whose values are set. I could of course just loop through looking for set values, but that seems silly when you think that entire blocks of bits can be skipped if the block has a value of zero.
So my questions is, before I set out to write some code, has somebody already done this? It seems like a logical use of dynamic_bit set so it does not seem implausible. If not, any suggestions or warnings?
Your description is a little vague to me but... are find_first/find_next enough? http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost-sandbox/boost-sandbox/b... Genny.
participants (2)
-
Andy Klapper
-
Gennaro Prota