christopher@baus.net

New pooled_list with comparison operators

I have a new version of the pooled list class available here: pooled_list.hpp.

I've cleaned up the code and made more internal types and structures private rather than public. I've also implemented comparison operators based on std::lexicographical_compare. Other than operator== I think they are of limited usefulness, but they are part of the standard.

When designing the class it wasn't clear to me what the semantics of combining lists which use different underlying pools should be. I decided (because when it comes to my code, I'm the decider) functions merge and splice, which combine two lists, will fail when operating on lists which use different underlying pools. In the previous version, I threw an exception if the lists used different pools. In this version I use BOOST_ASSERT to check the precondition. My colleagues and I agree that precondition failures which are the result of programmer error should assert rather than throw an exception, which is typically the approach taken by boost.

Show Comments