Boost multi_index ordered_unique Median Value

Posted by Autopulated on Stack Overflow See other posts from Stack Overflow or by Autopulated
Published on 2010-05-15T20:48:41Z Indexed on 2010/05/15 20:54 UTC
Read the original article Hit count: 178

Filed under:
|

I would like to quickly retrieve the median value from a boost multi_index container with an ordered_unique index, however the index iterators aren't random access (I don't understand why they can't be, though this is consistent with std::set...).

Is there a faster/neater way to do this other than incrementing an iterator container.size() / 2 times?

© Stack Overflow or respective owner

Related posts about boost

Related posts about multi-index