From 660d967ec0ac79ea2a43946be4c056ef2d21ffc4 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 22 May 2022 13:29:45 -0400 Subject: bug fixes; dynamic time measure; sync sample drawing --- source/circular.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/circular.hpp') diff --git a/source/circular.hpp b/source/circular.hpp index 6b82068..4f49322 100644 --- a/source/circular.hpp +++ b/source/circular.hpp @@ -21,7 +21,7 @@ public: CircularBuffer(Container& container) : m_begin(std::begin(container)), m_end(std::end(container)), - m_current(std::begin(container)) {} + m_current(m_begin) {} void put(const T& value) noexcept { *m_current = value; @@ -33,6 +33,11 @@ public: return std::distance(m_begin, m_end); } + void reset(const T& fill) noexcept { + std::fill(m_begin, m_end, fill); + m_current = m_begin; + } + private: Container::iterator m_begin; Container::iterator m_end; -- cgit v1.2.3