5#ifndef BITCOIN_UTIL_VECTOR_H
6#define BITCOIN_UTIL_VECTOR_H
8#include <initializer_list>
19template <
typename... Args>
20inline std::vector<
typename std::common_type<Args...>::type>
22 std::vector<
typename std::common_type<Args...>::type>
ret;
23 ret.reserve(
sizeof...(args));
26 (
void)std::initializer_list<int>{
27 (
ret.emplace_back(std::forward<Args>(args)), 0)...};
33 v1.reserve(
v1.size() +
v2.size());
34 for (
auto &
arg :
v2) {
35 v1.push_back(std::move(
arg));
42 v1.reserve(
v1.size() +
v2.size());
43 for (
const auto &
arg :
v2) {
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.
std::vector< typename std::common_type< Args... >::type > Vector(Args &&...args)
Construct a vector with the specified elements.