diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-05-23 14:45:54 +0100 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-06-22 08:05:10 +0100 |
commit | 5da70f719703084482933e103e561cc98163f370 (patch) | |
tree | 1926842ed2b90bf92b89cec6a314bb28c7287fe9 /src/common/scratch_buffer.h | |
parent | e3122c5b468fd59b7eded5a3a7300643d05616bc (diff) |
Remove memory allocations in some hot paths
Diffstat (limited to 'src/common/scratch_buffer.h')
-rw-r--r-- | src/common/scratch_buffer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index a69a5a7af9..6fe9079531 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h @@ -3,6 +3,9 @@ #pragma once +#include <iterator> + +#include "common/concepts.h" #include "common/make_unique_for_overwrite.h" namespace Common { @@ -16,6 +19,12 @@ namespace Common { template <typename T> class ScratchBuffer { public: + using iterator = T*; + using const_iterator = const T*; + using value_type = T; + using element_type = T; + using iterator_category = std::contiguous_iterator_tag; + ScratchBuffer() = default; explicit ScratchBuffer(size_t initial_capacity) |