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)...};
32template <
typename V>
inline V
Cat(V v1, V &&v2) {
33 v1.reserve(v1.size() + v2.size());
34 for (
auto &arg : v2) {
35 v1.push_back(std::move(arg));
41template <
typename V>
inline V
Cat(V v1,
const V &v2) {
42 v1.reserve(v1.size() + v2.size());
43 for (
const auto &arg : v2) {
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.