mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-07-02 03:03:28 +00:00
TAverage: don't implement AddValue inline
Former-commit-id: ce2276b3103a1e7b9cf3a24775e2e1233e95e12c
This commit is contained in:
parent
e2ba417809
commit
c5a4f660bb
@ -11,13 +11,7 @@ class TAverage : rstl::vector< T > {
|
|||||||
public:
|
public:
|
||||||
TAverage() {}
|
TAverage() {}
|
||||||
TAverage(int capacity, const T& value);
|
TAverage(int capacity, const T& value);
|
||||||
void AddValue(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;
|
|
||||||
}
|
|
||||||
rstl::optional_object< T > GetAverage() const;
|
rstl::optional_object< T > GetAverage() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -26,4 +20,13 @@ TAverage< T >::TAverage(int capacity, const T& value) {
|
|||||||
resize(capacity, 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
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user