//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // requires OutputIterator // && OutputIterator // && Predicate // && Predicate // OutIter // set_union(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2, // OutIter result, Compare comp); // UNSUPPORTED: c++98, c++03 #include #include #include #include #include "MoveOnly.h" int main() { std::vector lhs, rhs; lhs.push_back(MoveOnly(2)); rhs.push_back(MoveOnly(2)); std::vector res; std::set_union(std::make_move_iterator(lhs.begin()), std::make_move_iterator(lhs.end()), std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()), std::back_inserter(res)); assert(res.size() == 1); assert(res[0].get() == 2); }