#pragma once
#include <folly/CPortability.h>
#include <folly/Portability.h>
#include <cstdint>
#include <cstring>
#include <type_traits>
namespace folly {
namespace detail {
#if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) || \
FOLLY_HAS_BUILTIN(__builtin_strlen) || defined(_MSC_VER)
#define FOLLY_DETAIL_STRLEN …
#else
#define FOLLY_DETAIL_STRLEN …
#endif
#if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) || \
FOLLY_HAS_BUILTIN(__builtin_strcmp)
#define FOLLY_DETAIL_STRCMP …
#else
#define FOLLY_DETAIL_STRCMP …
#endif
template <
typename Char,
std::size_t = FOLLY_DETAIL_STRLEN(static_cast<const Char*>(""))>
constexpr std::size_t constexpr_strlen_internal(const Char* s, int) noexcept { … }
template <typename Char>
constexpr std::size_t constexpr_strlen_internal(
const Char* s, unsigned) noexcept { … }
template <typename Char>
constexpr std::size_t constexpr_strlen_fallback(const Char* s) noexcept { … }
static_assert …;
template <
typename Char,
int = FOLLY_DETAIL_STRCMP(static_cast<const Char*>(""), "")>
constexpr int constexpr_strcmp_internal(
const Char* s1, const Char* s2, int) noexcept { … }
template <typename Char>
constexpr int constexpr_strcmp_internal(
const Char* s1, const Char* s2, unsigned) noexcept { … }
template <typename Char>
constexpr int constexpr_strcmp_fallback(
const Char* s1, const Char* s2) noexcept { … }
#undef FOLLY_DETAIL_STRCMP
#undef FOLLY_DETAIL_STRLEN
}
template <typename Char>
constexpr std::size_t constexpr_strlen(const Char* s) noexcept { … }
template <typename Char>
constexpr int constexpr_strcmp(const Char* s1, const Char* s2) noexcept { … }
namespace detail {
template <typename V>
struct is_constant_evaluated_or_constinit_ { … };
}
constexpr bool is_constant_evaluated_or(
detail::is_constant_evaluated_or_constinit_<bool> const def) noexcept { … }
}