// (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_ALGORITHM_HPP #define BOOST_SETS_ALGORITHM_HPP // A collection of useful generic set algorithms. These should work for any // correctly implemented set data type. namespace boost { namespace sets { // Returns true if s is subset of t, which is to say if t contains the // elements of s. Note that s is also a subset t if s and t are equivalent. template inline bool is_subset(const Set& s, const Set& t) { return contains(t, s); } // Returns true if s is a proper subset of t. If so, s is a subset of t // but not equivalent to t. template inline bool is_proper_subset(const Set& s, const Set& t) { return (s != t) && is_subset(s, t); } // Return true if the two sets are disjoint. Two sets are disjoint if // their intersection is empty. Note that template inline bool are_disjoint(const Set& a, const Set& b) { return empty(intersection(a, b)); } } /* namespace sets */ } /* namespace boost */ #endif