23 #include <type_traits> 29 template <
typename Char>
33 *(s + 0) ==
Char(0) ? len + 0 :
34 *(s + 1) ==
Char(0) ? len + 1 :
35 *(s + 2) ==
Char(0) ? len + 2 :
36 *(s + 3) ==
Char(0) ? len + 3 :
37 *(s + 4) ==
Char(0) ? len + 4 :
38 *(s + 5) ==
Char(0) ? len + 5 :
39 *(s + 6) ==
Char(0) ? len + 6 :
40 *(s + 7) ==
Char(0) ? len + 7 :
46 "Someone appears to have broken constexpr_strlen...");
48 template <
typename Char>
50 return (*s1 ==
'\0' || *s1 != *s2)
51 ? (
static_cast<int>(*s1 - *s2))
56 template <
typename Char>
63 #if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) 65 return __builtin_strlen(s);
66 #elif defined(__GNUC__) && !defined(__clang__) 68 return std::strlen(s);
74 template <
typename Char>
81 #if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) 83 return __builtin_strcmp(s1, s2);
84 #elif defined(__GNUC__) && !defined(__clang__) 86 return std::strcmp(s1, s2);
—— Concurrent Priority Queue Implementation ——
constexpr int constexpr_strcmp_internal(const Char *s1, const Char *s2)
constexpr size_t constexpr_strlen_internal(const Char *s, size_t len)
constexpr int constexpr_strcmp(const Char *s1, const Char *s2)
constexpr size_t constexpr_strlen(const Char *s)