diff --git a/include/wjr/generic/math/bignum-config.hpp b/include/wjr/arch/generic/math/bignum-config.hpp similarity index 100% rename from include/wjr/generic/math/bignum-config.hpp rename to include/wjr/arch/generic/math/bignum-config.hpp diff --git a/include/wjr/x86/container/generic/bplus_tree.hpp b/include/wjr/arch/x86/container/generic/bplus_tree.hpp similarity index 99% rename from include/wjr/x86/container/generic/bplus_tree.hpp rename to include/wjr/arch/x86/container/generic/bplus_tree.hpp index 01a434b3..bbfd1064 100644 --- a/include/wjr/x86/container/generic/bplus_tree.hpp +++ b/include/wjr/arch/x86/container/generic/bplus_tree.hpp @@ -3,7 +3,7 @@ #include -#include +#include namespace wjr { diff --git a/include/wjr/x86/format/charconv.hpp b/include/wjr/arch/x86/format/charconv.hpp similarity index 99% rename from include/wjr/x86/format/charconv.hpp rename to include/wjr/arch/x86/format/charconv.hpp index a2081424..c503babe 100644 --- a/include/wjr/x86/format/charconv.hpp +++ b/include/wjr/arch/x86/format/charconv.hpp @@ -2,7 +2,7 @@ #define WJR_X86_FORMAT_CHARCONV_HPP__ #include -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/format/utf8/utf8.hpp b/include/wjr/arch/x86/format/utf8/utf8.hpp similarity index 81% rename from include/wjr/x86/format/utf8/utf8.hpp rename to include/wjr/arch/x86/format/utf8/utf8.hpp index fab73cbb..31fd3bd7 100644 --- a/include/wjr/x86/format/utf8/utf8.hpp +++ b/include/wjr/arch/x86/format/utf8/utf8.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_FORMAT_UTF8_HPP__ #define WJR_X86_FORMAT_UTF8_HPP__ -#include +#include namespace wjr::utf8 {} // namespace wjr::utf8 diff --git a/include/wjr/x86/json/lexer.hpp b/include/wjr/arch/x86/json/lexer.hpp similarity index 86% rename from include/wjr/x86/json/lexer.hpp rename to include/wjr/arch/x86/json/lexer.hpp index 192200f1..459bffc1 100644 --- a/include/wjr/x86/json/lexer.hpp +++ b/include/wjr/arch/x86/json/lexer.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_JSON_LEXER_HPP__ #define WJR_X86_JSON_LEXER_HPP__ -#include +#include #if WJR_HAS_SIMD(SSSE3) #define WJR_HAS_BUILTIN_JSON_LEXER_READER_READ_BUF WJR_HAS_DEF diff --git a/include/wjr/x86/json/string.hpp b/include/wjr/arch/x86/json/string.hpp similarity index 86% rename from include/wjr/x86/json/string.hpp rename to include/wjr/arch/x86/json/string.hpp index 60c71956..0c734328 100644 --- a/include/wjr/x86/json/string.hpp +++ b/include/wjr/arch/x86/json/string.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_JSON_STRING_HPP__ #define WJR_X86_JSON_STRING_HPP__ -#include +#include #if WJR_HAS_SIMD(SSE2) #define WJR_HAS_BUILTIN_JSON_PARSE_STRING WJR_HAS_DEF diff --git a/include/wjr/x86/math/add.hpp b/include/wjr/arch/x86/math/add.hpp similarity index 99% rename from include/wjr/x86/math/add.hpp rename to include/wjr/arch/x86/math/add.hpp index 8160946a..aa99b692 100644 --- a/include/wjr/x86/math/add.hpp +++ b/include/wjr/arch/x86/math/add.hpp @@ -30,7 +30,7 @@ #endif #if WJR_HAS_BUILTIN(ASM_ADDC) == 2 -#include +#include #endif namespace wjr { @@ -190,7 +190,7 @@ WJR_INTRINSIC_INLINE uint64_t asm_addc_cc(uint64_t a, uint64_t b, uint8_t c_in, #if WJR_HAS_BUILTIN(ASM_ADDC_N) #define WJR_ADDSUB_I 1 -#include +#include #endif #if WJR_HAS_BUILTIN(__ASM_ADD_128) diff --git a/include/wjr/x86/math/compare.hpp b/include/wjr/arch/x86/math/compare.hpp similarity index 98% rename from include/wjr/x86/math/compare.hpp rename to include/wjr/arch/x86/math/compare.hpp index 94ebb023..bfd2bb00 100644 --- a/include/wjr/x86/math/compare.hpp +++ b/include/wjr/arch/x86/math/compare.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_MATH_COMPARE_HPP__ #define WJR_X86_MATH_COMPARE_HPP__ -#include +#include namespace wjr { diff --git a/include/wjr/x86/math/div.hpp b/include/wjr/arch/x86/math/div.hpp similarity index 100% rename from include/wjr/x86/math/div.hpp rename to include/wjr/arch/x86/math/div.hpp diff --git a/include/wjr/x86/math/divider.hpp b/include/wjr/arch/x86/math/divider.hpp similarity index 100% rename from include/wjr/x86/math/divider.hpp rename to include/wjr/arch/x86/math/divider.hpp diff --git a/include/wjr/x86/math/find.hpp b/include/wjr/arch/x86/math/find.hpp similarity index 99% rename from include/wjr/x86/math/find.hpp rename to include/wjr/arch/x86/math/find.hpp index deb23164..e26b8056 100644 --- a/include/wjr/x86/math/find.hpp +++ b/include/wjr/arch/x86/math/find.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_MATH_FIND_HPP__ #define WJR_X86_MATH_FIND_HPP__ -#include +#include namespace wjr { diff --git a/include/wjr/x86/math/gen_addrsblsh_n.hpp b/include/wjr/arch/x86/math/gen_addrsblsh_n.hpp similarity index 100% rename from include/wjr/x86/math/gen_addrsblsh_n.hpp rename to include/wjr/arch/x86/math/gen_addrsblsh_n.hpp diff --git a/include/wjr/x86/math/gen_addsub.hpp b/include/wjr/arch/x86/math/gen_addsub.hpp similarity index 100% rename from include/wjr/x86/math/gen_addsub.hpp rename to include/wjr/arch/x86/math/gen_addsub.hpp diff --git a/include/wjr/x86/math/large-compare-impl.hpp b/include/wjr/arch/x86/math/large-compare-impl.hpp similarity index 99% rename from include/wjr/x86/math/large-compare-impl.hpp rename to include/wjr/arch/x86/math/large-compare-impl.hpp index 86e42bee..1d4e7803 100644 --- a/include/wjr/x86/math/large-compare-impl.hpp +++ b/include/wjr/arch/x86/math/large-compare-impl.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/math/large-find-impl.hpp b/include/wjr/arch/x86/math/large-find-impl.hpp similarity index 99% rename from include/wjr/x86/math/large-find-impl.hpp rename to include/wjr/arch/x86/math/large-find-impl.hpp index 803f0e2a..d32d7b3a 100644 --- a/include/wjr/x86/math/large-find-impl.hpp +++ b/include/wjr/arch/x86/math/large-find-impl.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/math/mul-impl.hpp b/include/wjr/arch/x86/math/mul-impl.hpp similarity index 100% rename from include/wjr/x86/math/mul-impl.hpp rename to include/wjr/arch/x86/math/mul-impl.hpp diff --git a/include/wjr/x86/math/mul.hpp b/include/wjr/arch/x86/math/mul.hpp similarity index 95% rename from include/wjr/x86/math/mul.hpp rename to include/wjr/arch/x86/math/mul.hpp index e15e244d..33ad8e64 100644 --- a/include/wjr/x86/math/mul.hpp +++ b/include/wjr/arch/x86/math/mul.hpp @@ -2,10 +2,10 @@ #define WJR_X86_MATH_MUL_HPP__ #include -#include +#include #if WJR_HAS_BUILTIN(MSVC_UMUL128) -#include +#include #endif namespace wjr { @@ -83,12 +83,12 @@ WJR_INTRINSIC_INLINE uint64_t asm_submul_1(uint64_t *dst, const uint64_t *src, s #if WJR_HAS_BUILTIN(ASM_ADDLSH_N) #define WJR_ADDSUB_I 1 -#include +#include #endif #if WJR_HAS_BUILTIN(ASM_RSBLSH_N) #define WJR_ADDSUB_I 0 -#include +#include #endif #if WJR_HAS_BUILTIN(ASM_BASECASE_MUL_S) diff --git a/include/wjr/x86/math/not.hpp b/include/wjr/arch/x86/math/not.hpp similarity index 99% rename from include/wjr/x86/math/not.hpp rename to include/wjr/arch/x86/math/not.hpp index 647a0c6e..3253afad 100644 --- a/include/wjr/x86/math/not.hpp +++ b/include/wjr/arch/x86/math/not.hpp @@ -2,7 +2,7 @@ #define WJR_X86_MATH_NOT_HPP__ #include -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/math/prefix_xor.hpp b/include/wjr/arch/x86/math/prefix_xor.hpp similarity index 95% rename from include/wjr/x86/math/prefix_xor.hpp rename to include/wjr/arch/x86/math/prefix_xor.hpp index b93c21ce..91119c7a 100644 --- a/include/wjr/x86/math/prefix_xor.hpp +++ b/include/wjr/arch/x86/math/prefix_xor.hpp @@ -2,7 +2,7 @@ #define WJR_X86_MATH_PREFIX_XOR_HPP__ #include -#include +#include namespace wjr { diff --git a/include/wjr/x86/math/set.hpp b/include/wjr/arch/x86/math/set.hpp similarity index 99% rename from include/wjr/x86/math/set.hpp rename to include/wjr/arch/x86/math/set.hpp index 9e9db144..924dfbf0 100644 --- a/include/wjr/x86/math/set.hpp +++ b/include/wjr/arch/x86/math/set.hpp @@ -3,7 +3,7 @@ #include -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/math/shift.hpp b/include/wjr/arch/x86/math/shift.hpp similarity index 99% rename from include/wjr/x86/math/shift.hpp rename to include/wjr/arch/x86/math/shift.hpp index f609b8de..c585c717 100644 --- a/include/wjr/x86/math/shift.hpp +++ b/include/wjr/arch/x86/math/shift.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_MATH_SHIFT_HPP__ #define WJR_X86_MATH_SHIFT_HPP__ -#include +#include #ifndef WJR_X86 #error "x86 required" diff --git a/include/wjr/x86/math/sub.hpp b/include/wjr/arch/x86/math/sub.hpp similarity index 98% rename from include/wjr/x86/math/sub.hpp rename to include/wjr/arch/x86/math/sub.hpp index 8a34d324..f7bd5cdd 100644 --- a/include/wjr/x86/math/sub.hpp +++ b/include/wjr/arch/x86/math/sub.hpp @@ -30,7 +30,7 @@ #endif #if WJR_HAS_BUILTIN(ASM_SUBC) == 2 -#include +#include #endif namespace wjr { @@ -128,7 +128,7 @@ WJR_INTRINSIC_INLINE uint64_t asm_subc_cc(uint64_t a, uint64_t b, uint8_t c_in, #if WJR_HAS_BUILTIN(ASM_SUBC_N) #define WJR_ADDSUB_I 0 -#include +#include #endif #if WJR_HAS_BUILTIN(__ASM_SUB_128) diff --git a/include/wjr/x86/simd/avx.hpp b/include/wjr/arch/x86/simd/avx.hpp similarity index 99% rename from include/wjr/x86/simd/avx.hpp rename to include/wjr/arch/x86/simd/avx.hpp index 0c392fcd..1571d41b 100644 --- a/include/wjr/x86/simd/avx.hpp +++ b/include/wjr/arch/x86/simd/avx.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_SIMD_AVX_HPP__ #define WJR_X86_SIMD_AVX_HPP__ -#include +#include namespace wjr { diff --git a/include/wjr/x86/simd/intrin.hpp b/include/wjr/arch/x86/simd/intrin.hpp similarity index 100% rename from include/wjr/x86/simd/intrin.hpp rename to include/wjr/arch/x86/simd/intrin.hpp diff --git a/include/wjr/x86/simd/simd.hpp b/include/wjr/arch/x86/simd/simd.hpp similarity index 99% rename from include/wjr/x86/simd/simd.hpp rename to include/wjr/arch/x86/simd/simd.hpp index 64df7d10..91356e8a 100644 --- a/include/wjr/x86/simd/simd.hpp +++ b/include/wjr/arch/x86/simd/simd.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_SIMD_SIMD_HPP__ #define WJR_X86_SIMD_SIMD_HPP__ -#include +#include namespace wjr { diff --git a/include/wjr/x86/simd/simd_cast.hpp b/include/wjr/arch/x86/simd/simd_cast.hpp similarity index 99% rename from include/wjr/x86/simd/simd_cast.hpp rename to include/wjr/arch/x86/simd/simd_cast.hpp index fb277802..4cee65cb 100644 --- a/include/wjr/x86/simd/simd_cast.hpp +++ b/include/wjr/arch/x86/simd/simd_cast.hpp @@ -4,7 +4,7 @@ #include #include -#include +#include namespace wjr { diff --git a/include/wjr/x86/simd/sse.hpp b/include/wjr/arch/x86/simd/sse.hpp similarity index 99% rename from include/wjr/x86/simd/sse.hpp rename to include/wjr/arch/x86/simd/sse.hpp index c9d82881..dbcf6003 100644 --- a/include/wjr/x86/simd/sse.hpp +++ b/include/wjr/arch/x86/simd/sse.hpp @@ -1,7 +1,7 @@ #ifndef WJR_X86_SIMD_SSE_HPP__ #define WJR_X86_SIMD_SSE_HPP__ -#include +#include #include diff --git a/include/wjr/container/generic/bplus_tree.hpp b/include/wjr/container/generic/bplus_tree.hpp index e0221611..e1517eca 100644 --- a/include/wjr/container/generic/bplus_tree.hpp +++ b/include/wjr/container/generic/bplus_tree.hpp @@ -30,7 +30,7 @@ #include #if defined(WJR_X86) -#include +#include #endif namespace wjr { diff --git a/include/wjr/format/charconv.hpp b/include/wjr/format/charconv.hpp index 73c3e158..11c035b4 100644 --- a/include/wjr/format/charconv.hpp +++ b/include/wjr/format/charconv.hpp @@ -13,7 +13,7 @@ #include #if defined(WJR_X86) -#include +#include #endif namespace wjr { diff --git a/include/wjr/format/utf8/utf8.hpp b/include/wjr/format/utf8/utf8.hpp index 58f734d4..225bce46 100644 --- a/include/wjr/format/utf8/utf8.hpp +++ b/include/wjr/format/utf8/utf8.hpp @@ -6,7 +6,7 @@ #include #if defined(WJR_X86) -#include +#include #endif namespace wjr::utf8 { diff --git a/include/wjr/json/json.hpp b/include/wjr/json/json.hpp index 5e3fd9ba..46c13d5d 100644 --- a/include/wjr/json/json.hpp +++ b/include/wjr/json/json.hpp @@ -20,6 +20,15 @@ WJR_INTRINSIC_INLINE result check(const reader &rd) noexcept { template class basic_json; +template +struct is_json : std::false_type {}; + +template +struct is_json> : std::true_type {}; + +template +inline constexpr bool is_json_v = is_json::value; + namespace detail { template