Simplify away ValueListInserter

plus minor cleanups

STC: https://tests.stockfishchess.org/tests/view/616f059b40f619782fd4f73f
LLR: 2.94 (-2.94,2.94) <-2.50,0.50>
Total: 84992 W: 21244 L: 21197 D: 42551
Ptnml(0-2): 279, 9005, 23868, 9078, 266

closes https://github.com/official-stockfish/Stockfish/pull/3749

No functional change
This commit is contained in:
mstembera
2021-10-19 10:49:02 -07:00
committed by Joost VandeVondele
parent 8a8640a761
commit 644f6d4790
4 changed files with 24 additions and 42 deletions

View File

@@ -111,22 +111,6 @@ class RunningAverage {
int64_t average;
};
template <typename T>
class ValueListInserter {
public:
ValueListInserter(T* v, std::size_t& s) :
values(v),
size(&s)
{
}
void push_back(const T& value) { values[(*size)++] = value; }
private:
T* values;
std::size_t* size;
};
template <typename T, std::size_t MaxSize>
class ValueList {
@@ -140,7 +124,6 @@ public:
const T& operator[](std::size_t index) const { return values_[index]; }
const T* begin() const { return values_; }
const T* end() const { return values_ + size_; }
operator ValueListInserter<T>() { return ValueListInserter(values_, size_); }
void swap(ValueList& other) {
const std::size_t maxSize = std::max(size_, other.size_);