5#ifndef BITCOIN_UTIL_VECTOR_H
6#define BITCOIN_UTIL_VECTOR_H
9#include <initializer_list>
22template<
typename... Args>
23inline std::vector<std::common_type_t<Args...>>
Vector(Args&&...
args)
25 std::vector<std::common_type_t<Args...>>
ret;
28 (
void)std::initializer_list<int>{(
ret.emplace_back(std::forward<Args>(
args)), 0)...};
36 v1.reserve(v1.size() + v2.size());
37 for (
auto&
arg : v2) {
38 v1.push_back(std::move(
arg));
47 v1.reserve(v1.size() + v2.size());
48 for (
const auto&
arg : v2) {
72template<
typename V,
typename L>
75 for (
const auto&
el :
vec) {
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.
std::optional< V > FindFirst(const std::vector< V > &vec, const L fnc)
std::vector< std::common_type_t< Args... > > Vector(Args &&... args)
Construct a vector with the specified elements.
void ClearShrink(V &v) noexcept
Clear a vector (or std::deque) and release its allocated memory.