From c5a4f660bb82091bd1c1149ce696a8e600c74e1d Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Mon, 3 Oct 2022 18:03:57 +0300 Subject: [PATCH] TAverage: don't implement AddValue inline Former-commit-id: ce2276b3103a1e7b9cf3a24775e2e1233e95e12c --- include/Kyoto/TAverage.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/Kyoto/TAverage.hpp b/include/Kyoto/TAverage.hpp index 71f92258..5d36d0b2 100644 --- a/include/Kyoto/TAverage.hpp +++ b/include/Kyoto/TAverage.hpp @@ -11,13 +11,7 @@ class TAverage : rstl::vector< T > { public: TAverage() {} TAverage(int capacity, const T& value); - void AddValue(const T& value) { - push_back(value); - for (int i = size() - 1; i > 0; --i) { - operator[](i) = operator[](i - 1); - } - operator[](0) = value; - } + void AddValue(const T& value); rstl::optional_object< T > GetAverage() const; }; @@ -26,4 +20,13 @@ TAverage< T >::TAverage(int capacity, const T& value) { resize(capacity, value); } +template < typename T > +void TAverage< T >::AddValue(const T& value) { + push_back(value); + for (int i = size() - 1; i > 0; --i) { + operator[](i) = operator[](i - 1); + } + operator[](0) = value; +} + #endif