// (C) Copyright 2008-2009 SDML (www.sdml.info) // // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Copyright Andrew Sutton 2007 // // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_SETS_DYNAMIC_BITSET_DIFFERENCE_HPP #define BOOST_SETS_DYNAMIC_BITSET_DIFFERENCE_HPP #include namespace boost { namespace sets { // Compute the set difference for bitsets. This corresponds to the // subtraction operator for dynamic bitsets. This is basically this // operation r = s & ~t, which ands s and the complement of t. template inline void difference(const dynamic_bitset& s, const dynamic_bitset& t, dynamic_bitset& result) { result = s - t; } // Compute the set difference for bitsets. template inline dynamic_bitset difference(const dynamic_bitset& s, const dynamic_bitset& t) { return s - t; } template dynamic_bitset difference_inplace(dynamic_bitset& s, const dynamic_bitset& t) { s -= t; } // Compute the symmetric difference for bitsets. This is simply a binary // xor operation. template inline void symmetric_difference(const dynamic_bitset& s, const dynamic_bitset& t, dynamic_bitset& result) { result = s ^ t; } // Compute the set difference for bitsets. template inline dynamic_bitset symmertic_difference(const dynamic_bitset& s, const dynamic_bitset& t) { return s ^ t; } template dynamic_bitset symmetric_difference_inplace(dynamic_bitset& s, const dynamic_bitset& t) { s ^= t; } } /* namespace sets */ } /* namespace boost */ #endif