36#if __cplusplus < 201402L
37# error kblib requires C++14 or higher
42#define KBLIB_VERS_MAJ 00
43#define KBLIB_VERS_MIN 04
44#define KBLIB_VERS_REV 00
45#define KBLIB_VERS_I(P, MAJ, MIN, REV) KBLIB_VERS_I2(P, MAJ, MIN, REV)
46#define KBLIB_VERS_I2(P, MAJ, MIN, REV) P##MAJ##MIN##REV
50 KBLIB_VERS_I(KBV, KBLIB_VERS_MAJ, KBLIB_VERS_MIN, KBLIB_VERS_REV)
53 KBLIB_VERS_I(1, KBLIB_VERS_MAJ, KBLIB_VERS_MIN, KBLIB_VERS_REV)
60#if (__cplusplus >= 201703L)
61# define KBLIB_USE_CXX17 1
63# define KBLIB_USE_CXX17 0
71#if (__cplusplus >= 202002L)
72# define KBLIB_USE_CXX20 1
74# define KBLIB_USE_CXX20 0
81#ifndef KBLIB_USE_STRING_VIEW
83# define KBLIB_USE_STRING_VIEW 1
85# define KBLIB_USE_STRING_VIEW 0
94# define KBLIB_CXX20(args) args
96# define KBLIB_CXX20(args)
100#define KBLIB_VERS_NS_I(VS, CXX17, CXX_SV, CXX20) \
101 KBLIB_VERS_NS_I2(VS, CXX17, CXX_SV, CXX20)
102#define KBLIB_VERS_NS_I2(VS, CXX17, CXX_SV, CXX20) VS##_##CXX17##CXX_SV##CXX20
104#define KBLIB_VERS_NS \
105 KBLIB_VERS_NS_I(KBLIB_VERS_S, KBLIB_USE_CXX17, KBLIB_USE_STRING_VIEW, \
109# define KBLIB_NS KBLIB_VERS_NS
113# define KBLIB_NS kblib
129# define KBLIB_NODISCARD [[nodiscard]]
130# define KBLIB_UNUSED [[maybe_unused]]
132# define KBLIB_NODISCARD [[gnu::warn_unused_result]]
133# define KBLIB_UNUSED [[gnu::unused]]
137# define KBLIB_CONSTANT constexpr inline
138# define KBLIB_CONSTANT_V constexpr inline bool
139# define KBLIB_CONSTANT_M constexpr inline static
140# define KBLIB_CONSTANT_MV constexpr inline static bool
142# define KBLIB_CONSTANT constexpr
143# define KBLIB_CONSTANT_V constexpr bool
144# define KBLIB_CONSTANT_M constexpr static
145# define KBLIB_CONSTANT_MV constexpr static bool
148#if defined(_DOXYGEN_) and not defined(KBLIB_DEF_MACROS)
154# define KBLIB_DEF_MACROS
172 template <
typename Container, bool,
typename...>
175 template <
typename T>
180 template <
typename T>
185 template <
typename T>
190 template <
typename T>
199 if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) {
201 }
else if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) {
202 return endian::little;
204 return endian::weird;
219 return endian::little;
224#ifdef KBLIB_CONSISTENT_HASHES
233using 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.