Fix log message filtering

Taking the sizeof a pointer doesn't give you the array length!
This commit is contained in:
John Firebaugh
2014-10-17 12:02:51 -07:00
parent 4e9688e430
commit d54809b04a

View File

@@ -19,9 +19,9 @@ public:
class Log {
private:
template <typename T>
constexpr static bool includes(const T e, T const *l, const size_t i = 0) {
return i >= sizeof l ? false : *(l + i) == e ? true : includes(e, l, i + 1);
template <typename T, size_t N>
constexpr static bool includes(const T e, const T (&l)[N], const size_t i = 0) {
return i < N && (l[i] == e || includes(e, l, i + 1));
}
public: