QStaticByteArrayMatcher: add a useful comment

Took me a few seconds to figure this out, and I'm the author of the
class, so leave a comment for my future self (and anyone else).

Pick-to: 6.3 6.2 5.15
Change-Id: I65a7aa6f8abf9d671f7d9ba45400f19e0f46728f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
bb10
Marc Mutz 2022-01-21 14:29:27 +01:00
parent 6db1284de9
commit e1654aeb2e
1 changed files with 1 additions and 0 deletions

View File

@ -147,6 +147,7 @@ template <uint N>
class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
{
char m_pattern[N];
// N includes the terminating '\0'!
static_assert(N > 2, "QStaticByteArrayMatcher makes no sense for finding a single-char pattern");
public:
explicit constexpr QStaticByteArrayMatcher(const char (&patternToMatch)[N]) noexcept