mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
pow-testgiver support
This commit is contained in:
parent
dbde9c1c40
commit
f064b1047a
257 changed files with 6665 additions and 2608 deletions
|
@ -18,10 +18,10 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
#include "td/utils/common.h"
|
||||
#include "td/utils/Span.h"
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace td {
|
||||
|
||||
|
@ -30,7 +30,7 @@ class VectorQueue {
|
|||
public:
|
||||
template <class S>
|
||||
void push(S &&s) {
|
||||
vector_.push_back(std::forward<S>(s));
|
||||
vector_.emplace_back(std::forward<S>(s));
|
||||
}
|
||||
template <class... Args>
|
||||
void emplace(Args &&... args) {
|
||||
|
@ -62,21 +62,21 @@ class VectorQueue {
|
|||
size_t size() const {
|
||||
return vector_.size() - read_pos_;
|
||||
}
|
||||
T *data() {
|
||||
const T *data() const {
|
||||
return vector_.data() + read_pos_;
|
||||
}
|
||||
const T *data() const {
|
||||
T *data() {
|
||||
return vector_.data() + read_pos_;
|
||||
}
|
||||
Span<T> as_span() const {
|
||||
return {data(), size()};
|
||||
}
|
||||
MutableSpan<T> as_mutable_span() {
|
||||
return {data(), size()};
|
||||
return {vector_.data() + read_pos_, size()};
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<T> vector_;
|
||||
vector<T> vector_;
|
||||
size_t read_pos_{0};
|
||||
|
||||
void try_shrink() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue