5 #ifndef BITCOIN_UTIL_VECTOR_H
6 #define BITCOIN_UTIL_VECTOR_H
8 #include <initializer_list>
20 template<
typename... Args>
21 inline std::vector<
typename std::common_type<Args...>::type>
Vector(Args&&...
args)
23 std::vector<
typename std::common_type<Args...>::type>
ret;
26 (void)std::initializer_list<int>{(
ret.emplace_back(std::forward<Args>(
args)), 0)...};
32 inline V
Cat(V v1, V&& v2)
34 v1.reserve(v1.size() + v2.size());
35 for (
auto& arg : v2) {
36 v1.push_back(std::move(arg));
43 inline V
Cat(V v1,
const V& v2)
45 v1.reserve(v1.size() + v2.size());
46 for (
const auto& arg : v2) {
std::vector< typename std::common_type< Args... >::type > Vector(Args &&... args)
Construct a vector with the specified elements.
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.