diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-21 14:29:27 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-21 20:45:11 +0000 |
commit | e1654aeb2e7fa282af045496c4903b06d2893e21 (patch) | |
tree | d09bf24891eb9c587c35a279f2387bc4fc4f0af1 /src/corelib/text/qbytearraymatcher.h | |
parent | 6db1284de91b9a5112e602fd59a3826588f0fce9 (diff) |
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>
Diffstat (limited to 'src/corelib/text/qbytearraymatcher.h')
-rw-r--r-- | src/corelib/text/qbytearraymatcher.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h index d9ea638500..2a65a257ee 100644 --- a/src/corelib/text/qbytearraymatcher.h +++ b/src/corelib/text/qbytearraymatcher.h @@ -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 |