// (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_ORDERED_SET_UNION_HPP #define BOOST_SETS_ORDERED_SET_UNION_HPP namespace boost { namespace sets { // Compute the union of s and t and store it in result. template inline void union_(const std::set& s, const std::set& t, std::set& result) { std::set_union(s.begin(), s.end(), t.begin(), t.end(), std::inserter(result, result.begin())); } // Return the intersection of s and t. template inline std::set union_(const std::set& s, const std::set& t) { std::set result; union_(s, t, result); return result; } // Add all elements in t to the set s. template inline void union_inplace(std::set& s, const std::set& t) { s = union_(s, t); } } /* namespace sets */ } /* namespace boost */ #endif