boostorg / icl

Boost.org icl module
http://boost.org/libs/icl
10 stars 44 forks source link

Use operator | and |= for set addition #4

Closed changlan closed 9 years ago

changlan commented 9 years ago

As mentioned in the document (http://www.boost.org/doc/libs/1_56_0/libs/icl/doc/html/boost_icl/function_reference/addition.html), a set union semantics is often attached operators |= and |. This is the case, for example, when using boost::dynamic_bitset, which does not provide operators += and + for set union semantics.

However, the original implementation of operators |= and | still uses += and + for the underlying set container. This makes operators |= and | less useful. Furthermore, we can't use boost::dynamic_bitset for icl objects currently. I think this is an unnecessary limitation.

A proper fix would be changing += and + into |= and | when users call the |= and | operators. The code will be more consistent with the statement above.

changlan commented 9 years ago

This patch is not complete. Wait until I finishes patching.