Files
rippled/include/xrpl/tx/paths/detail/FlatSets.h
2026-02-17 18:10:07 +00:00

25 lines
595 B
C++

#pragma once
#include <boost/container/flat_set.hpp>
namespace xrpl {
/** Given two flat sets dst and src, compute dst = dst union src
@param dst set to store the resulting union, and also a source of elements
for the union
@param src second source of elements for the union
*/
template <class T>
void
SetUnion(boost::container::flat_set<T>& dst, boost::container::flat_set<T> const& src)
{
if (src.empty())
return;
dst.reserve(dst.size() + src.size());
dst.insert(boost::container::ordered_unique_range_t{}, src.begin(), src.end());
}
} // namespace xrpl