From ae20fb0471405568280cf4df39a6eb7d6a959ffe Mon Sep 17 00:00:00 2001 From: laowai9189 Date: Fri, 6 Sep 2024 14:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=98constexpr=E2=80=99=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit httplib.h: In member function ‘constexpr size_t httplib::detail::case_ignore_hash::operator()(const string&) const’: httplib.h:359:30: error: call to non-‘constexpr’ function ‘const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::data() const [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 359 | return hash_core(key.data(), key.size(), 0); --- httplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index a8bc856938..2196593ee5 100644 --- a/httplib.h +++ b/httplib.h @@ -355,7 +355,7 @@ struct case_ignore_equal { }; struct case_ignore_hash { - constexpr size_t operator()(const std::string &key) const { + size_t operator()(const std::string &key) const { return hash_core(key.data(), key.size(), 0); }