Fix log message filtering
Taking the sizeof a pointer doesn't give you the array length!
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user