From 72d8d78d365db09d345976d0bc9c6045870f8f9a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 25 Mar 2016 22:53:31 +0900 Subject: [PATCH] src: Don't allow const char * in 2nd argument of streq_l(S[N], T) --- src/util.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/util.h b/src/util.h index b8b04127..79b5f94e 100644 --- a/src/util.h +++ b/src/util.h @@ -318,14 +318,9 @@ bool streq_l(const CharT(&a)[N], InputIt b, size_t blen) { return streq(a, a + (N - 1), b, b + blen); } -template -bool streq_l(const CharT(&a)[N], const std::string &b) { - return streq(a, a + (N - 1), std::begin(b), std::end(b)); -} - -template -bool streq_l(const CharT(&a)[N], const StringRef &b) { - return streq(a, a + (N - 1), std::begin(b), std::end(b)); +template +bool streq_l(const CharT(&a)[N], const T &b) { + return streq(a, a + (N - 1), b.begin(), b.end()); } // Returns true if |a| contains |b|. If both |a| and |b| are empty,