36#if __cplusplus < 201402L
37# error kblib requires C++14 or higher
41#define KBLIB_VERS 1000203
43#define KBLIB_VERS_MAJ 0
44#define KBLIB_VERS_MIN 2
45#define KBLIB_VERS_REV 3
47#define KBLIB_VERS_S KBLIB_VERS_MAJ##_##KBLIB_VERS_MIN##_##KBLIB_VERS_REV
49#define KBLIB_VERS_NS api_v##KBLIB_VERS_S
56#define KBLIB_USE_CXX17 __cplusplus >= 201703L
63#define KBLIB_USE_CXX20 __cplusplus >= 202002L
69#ifndef KBLIB_USE_STRING_VIEW
70# define KBLIB_USE_STRING_VIEW __cpp_lib_string_view
81# define KBLIB_NODISCARD [[nodiscard]]
83# define KBLIB_NODISCARD [[gnu::warn_unused_result]]
92# define KBLIB_UNUSED [[maybe_unused]]
94# define KBLIB_UNUSED [[gnu::unused]]
98# define KBLIB_CONSTANT constexpr
99# define KBLIB_CONSTANT_V constexpr bool
100# define KBLIB_CONSTANT_M constexpr inline static
101# define KBLIB_CONSTANT_MV constexpr inline static bool
103# define KBLIB_CONSTANT constexpr static
104# define KBLIB_CONSTANT_V constexpr static bool
105# define KBLIB_CONSTANT_M constexpr static
106# define KBLIB_CONSTANT_MV constexpr static bool
114# define KBLIB_CXX20(args) args
116# define KBLIB_CXX20(args)
119#if defined(_DOXYGEN_) and not defined(KBLIB_DEF_MACROS)
125# define KBLIB_DEF_MACROS
142 template <
typename Container, bool,
typename...>
145 template <
typename T>
150 template <
typename T>
155 template <
typename T>
160 template <
typename T>
169 if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) {
171 }
else if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) {
194#ifdef KBLIB_CONSISTENT_HASHES
203using byte =
unsigned char;
constexpr auto get_hash_order() -> endian
typename no_dangle< T >::type no_dangle_t
The main namespace in which all entities from kblib are defined.
constexpr endian system_endian
constexpr endian hash_order
#define KBLIB_NODISCARD
This internal macro is used to provide a fallback for [[nodiscard]] in C++14.