mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-07 02:36:47 +00:00
25 lines
595 B
C++
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
|