diff --git a/src/include/thirdparty/field_reflection.hpp b/src/fs/path.cpp similarity index 100% rename from src/include/thirdparty/field_reflection.hpp rename to src/fs/path.cpp diff --git a/src/include/clone.hpp b/src/include/cx/clone.hpp similarity index 51% rename from src/include/clone.hpp rename to src/include/cx/clone.hpp index 80dbfff..c3bebef 100644 --- a/src/include/clone.hpp +++ b/src/include/cx/clone.hpp @@ -1,11 +1,11 @@ -#ifndef _H_LIBCP_CLONE -#define _H_LIBCP_CLONE +#ifndef _H_LIBCX_CLONE +#define _H_LIBCX_CLONE -#include +#include template concept Format = requires(T t) { { t.clone() } -> stl::same_as; }; -#endif // _H_LIBCP_CLONE +#endif // _H_LIBCX_CLONE diff --git a/src/include/collections/hasmap.hpp b/src/include/cx/collections/hashmap.hpp similarity index 73% rename from src/include/collections/hasmap.hpp rename to src/include/cx/collections/hashmap.hpp index b7add1a..1f4e94b 100644 --- a/src/include/collections/hasmap.hpp +++ b/src/include/cx/collections/hashmap.hpp @@ -1,8 +1,8 @@ -#ifndef _H_LIBCP_COLLECTIONS_HASHMAP -#define _H_LIBCP_COLLECTIONS_HASHMAP +#ifndef _H_LIBCX_COLLECTIONS_HASHMAP +#define _H_LIBCX_COLLECTIONS_HASHMAP -#include "option.hpp" -#include +#include +#include #include namespace __internal { @@ -32,4 +32,4 @@ public: Option get(K& key) {} }; -#endif // !_H_LIBCP_COLLECTIONS_HASHMAP +#endif // !_H_LIBCX_COLLECTIONS_HASHMAP diff --git a/src/include/collections/vec.hpp b/src/include/cx/collections/vec.hpp similarity index 94% rename from src/include/collections/vec.hpp rename to src/include/cx/collections/vec.hpp index 1ff501c..fcd9d01 100644 --- a/src/include/collections/vec.hpp +++ b/src/include/cx/collections/vec.hpp @@ -1,10 +1,10 @@ -#ifndef _H_LIBCP_COLLECTIONS_VEC -#define _H_LIBCP_COLLECTIONS_VEC +#ifndef _H_LIBCX_COLLECTIONS_VEC +#define _H_LIBCX_COLLECTIONS_VEC -#include -#include +#include +#include #include -#include +#include template class Vec { @@ -122,4 +122,4 @@ public: } }; -#endif // _H_LIBCP_COLLECTIONS_VEC \ No newline at end of file +#endif // _H_LIBCX_COLLECTIONS_VEC \ No newline at end of file diff --git a/src/include/config/platform.hpp b/src/include/cx/config/platform.hpp similarity index 87% rename from src/include/config/platform.hpp rename to src/include/cx/config/platform.hpp index 3c809a9..0a48f19 100644 --- a/src/include/config/platform.hpp +++ b/src/include/cx/config/platform.hpp @@ -1,4 +1,4 @@ -#ifndef _H_LIBCP_CONFIG_PLATFORM +#ifndef _H_LIBCX_CONFIG_PLATFORM #if defined(__linux__) #define PLATFORM_LINUX @@ -20,4 +20,4 @@ #error This platform is not supported by this library yet #endif // PLATFORM_UNKNOWN -#endif // !_H_LIBCP_CONFIG_PLATFORM +#endif // !_H_LIBCX_CONFIG_PLATFORM diff --git a/src/include/cx/format.hpp b/src/include/cx/format.hpp new file mode 100644 index 0000000..8745ad7 --- /dev/null +++ b/src/include/cx/format.hpp @@ -0,0 +1,8 @@ +#ifndef _H_LIBCX_FORMAT +#define _H_LIBCX_FORMAT + +namespace format { +#include +} + +#endif // _H_LIBCX_FORMAT \ No newline at end of file diff --git a/src/include/format/base_types.hpp b/src/include/cx/format/base_types.hpp similarity index 87% rename from src/include/format/base_types.hpp rename to src/include/cx/format/base_types.hpp index 0a41e59..d15da6a 100644 --- a/src/include/format/base_types.hpp +++ b/src/include/cx/format/base_types.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_FORMAT_BASE_TYPES -#define _H_LIBCP_FORMAT_BASE_TYPES +#ifndef _H_LIBCX_FORMAT_BASE_TYPES +#define _H_LIBCX_FORMAT_BASE_TYPES -#include +#include extern "C" { int snprintf(char* __restrict s, size_t maxlen, const char* __restrict format, ...); @@ -51,4 +51,4 @@ struct Formatter { } }; -#endif // !_H_LIBCP_FORMAT_BASE_TYPES +#endif // !_H_LIBCX_FORMAT_BASE_TYPES diff --git a/src/include/format/fmt.hpp b/src/include/cx/format/fmt.hpp similarity index 92% rename from src/include/format/fmt.hpp rename to src/include/cx/format/fmt.hpp index 044bc44..4591ca9 100644 --- a/src/include/format/fmt.hpp +++ b/src/include/cx/format/fmt.hpp @@ -1,13 +1,12 @@ -#ifndef _H_LIBCP_FORMAT_FMT -#define _H_LIBCP_FORMAT_FMT +#ifndef _H_LIBCX_FORMAT_FMT +#define _H_LIBCX_FORMAT_FMT -#include +#include #include -#include +#include #include -#include - -#include "format/base_types.hpp" +#include +#include template concept Format = requires(T t) { @@ -91,4 +90,4 @@ struct Formatter> { }; #endif // __CONCEPT_ONLY -#endif // _H_LIBCP_FORMAT_FMT \ No newline at end of file +#endif // _H_LIBCX_FORMAT_FMT \ No newline at end of file diff --git a/src/include/format/obj_fmt_helper.hpp b/src/include/cx/format/obj_fmt_helper.hpp similarity index 78% rename from src/include/format/obj_fmt_helper.hpp rename to src/include/cx/format/obj_fmt_helper.hpp index 428468c..46bfcb1 100644 --- a/src/include/format/obj_fmt_helper.hpp +++ b/src/include/cx/format/obj_fmt_helper.hpp @@ -1,10 +1,10 @@ -#ifndef _H_LIBCP_FORMAT_OBJ_FMT_HELPER -#define _H_LIBCP_FORMAT_OBJ_FMT_HELPER +#ifndef _H_LIBCX_FORMAT_OBJ_FMT_HELPER +#define _H_LIBCX_FORMAT_OBJ_FMT_HELPER #include -#include -#include -#include +#include +#include +#include class ObjFmtHelper { private: @@ -40,4 +40,4 @@ public: } }; -#endif // !_H_LIBCP_FORMAT_OBJ_FMT_HELPER +#endif // !_H_LIBCX_FORMAT_OBJ_FMT_HELPER diff --git a/src/include/cx/fs/path.hpp b/src/include/cx/fs/path.hpp new file mode 100644 index 0000000..47cfe9a --- /dev/null +++ b/src/include/cx/fs/path.hpp @@ -0,0 +1,21 @@ +#ifndef _H_LIBCX_FS_PATH +#define _H_LIBCX_FS_PATH + +#include +#include + +class Path { +private: + Vec parts; + +public: + Path(); + Path(const char* path); + Path(String path); + + void push(const char* path); + void push(String path); + Option pop(); +}; + +#endif // !_H_LIBCX_FS_PATH diff --git a/src/include/hash/hash.hpp b/src/include/cx/hash/hash.hpp similarity index 73% rename from src/include/hash/hash.hpp rename to src/include/cx/hash/hash.hpp index 6cba728..f7622b8 100644 --- a/src/include/hash/hash.hpp +++ b/src/include/cx/hash/hash.hpp @@ -1,7 +1,8 @@ - +#ifndef _H_LIBCX_HASH_HASH +#define _H_LIBCX_HASH_HASH #include -#include +#include #include #define HASH_SIZE 4 @@ -15,3 +16,4 @@ concept Hash = requires(T t) { } || requires(T t) { { Hasher::hash(t) } -> stl::same_as; }; +#endif // !_H_LIBCX_HASH_HASH diff --git a/src/include/io/print.hpp b/src/include/cx/io/print.hpp similarity index 77% rename from src/include/io/print.hpp rename to src/include/cx/io/print.hpp index 93c88ce..c541364 100644 --- a/src/include/io/print.hpp +++ b/src/include/cx/io/print.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_IO_PRINT -#define _H_LIBCP_IO_PRINT +#ifndef _H_LIBCX_IO_PRINT +#define _H_LIBCX_IO_PRINT -#include +#include extern "C" { int putchar(int c); @@ -22,4 +22,4 @@ void println(const char* fmt, Types... args) { putchar('\n'); } -#endif // !_H_LIBCP_IO_PRINT +#endif // !_H_LIBCX_IO_PRINT diff --git a/src/include/logger.hpp b/src/include/cx/logger.hpp similarity index 91% rename from src/include/logger.hpp rename to src/include/cx/logger.hpp index 0be0a50..b9f3bbe 100644 --- a/src/include/logger.hpp +++ b/src/include/cx/logger.hpp @@ -1,9 +1,10 @@ -#include "format/fmt.hpp" -#ifndef _H_LIBCP_LOGGER +#ifndef _H_LIBCX_LOGGER +#define _H_LIBCX_LOGGER -#include -#include -#include +#include +#include +#include +#include namespace log { #define LOG_LEVEL_COUNT 4 @@ -57,4 +58,4 @@ namespace log { } } // namespace log -#endif // !_H_LIBCP_LOGGER +#endif // !_H_LIBCX_LOGGER diff --git a/src/include/option.hpp b/src/include/cx/option.hpp similarity index 92% rename from src/include/option.hpp rename to src/include/cx/option.hpp index 5e6a92e..4a12f6e 100644 --- a/src/include/option.hpp +++ b/src/include/cx/option.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_OPTION -#define _H_LIBCP_OPTION -#include +#ifndef _H_LIBCX_OPTION +#define _H_LIBCX_OPTION +#include extern "C" { int puts(const char* s); @@ -73,4 +73,4 @@ public: } }; -#endif // _H_LIBCP_OPTION \ No newline at end of file +#endif // _H_LIBCX_OPTION \ No newline at end of file diff --git a/src/include/result.hpp b/src/include/cx/result.hpp similarity index 96% rename from src/include/result.hpp rename to src/include/cx/result.hpp index 5bdeba3..77c07ac 100644 --- a/src/include/result.hpp +++ b/src/include/cx/result.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_RESULT -#define _H_LIBCP_RESULT +#ifndef _H_LIBCX_RESULT +#define _H_LIBCX_RESULT -#include +#include extern "C" { int puts(const char* s); @@ -134,4 +134,4 @@ public: } }; -#endif // _H_LIBCP_RESULT \ No newline at end of file +#endif // _H_LIBCX_RESULT \ No newline at end of file diff --git a/src/include/cx/std.hpp b/src/include/cx/std.hpp new file mode 100644 index 0000000..521d4c8 --- /dev/null +++ b/src/include/cx/std.hpp @@ -0,0 +1,13 @@ + +#ifndef _H_LIBCX +#define _H_LIBCX + +#include +#include +#include +#include +#include +#include +#include + +#endif // _H_LIBCX \ No newline at end of file diff --git a/src/include/stddef.hpp b/src/include/cx/stddef.hpp similarity index 76% rename from src/include/stddef.hpp rename to src/include/cx/stddef.hpp index ac691f8..57ac423 100644 --- a/src/include/stddef.hpp +++ b/src/include/cx/stddef.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STDDEF +#ifndef _H_LIBCX_STDDEF using size_t = decltype(sizeof(int)); using ptrdiff_t = decltype(static_cast(nullptr) - static_cast(nullptr)); using nullptr_t = decltype(nullptr); -#endif // !_H_LIBCP_STDDEF +#endif // !_H_LIBCX_STDDEF diff --git a/src/include/cx/stl.hpp b/src/include/cx/stl.hpp new file mode 100644 index 0000000..321496e --- /dev/null +++ b/src/include/cx/stl.hpp @@ -0,0 +1,21 @@ +#ifndef _H_LIBCX_STL +#define _H_LIBCX_STL + +namespace stl { +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +} // namespace stl + +#endif // _H_LIBCX_STL \ No newline at end of file diff --git a/src/include/stl/add_lvalue_reference.hpp b/src/include/cx/stl/add_lvalue_reference.hpp similarity index 82% rename from src/include/stl/add_lvalue_reference.hpp rename to src/include/cx/stl/add_lvalue_reference.hpp index 015842b..1bded04 100644 --- a/src/include/stl/add_lvalue_reference.hpp +++ b/src/include/cx/stl/add_lvalue_reference.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_ADD_LVALUE_REF -#define _H_LIBCP_STL_ADD_LVALUE_REF +#ifndef _H_LIBCX_STL_ADD_LVALUE_REF +#define _H_LIBCX_STL_ADD_LVALUE_REF -#include +#include #if __has_builtin(__add_lvalue_reference) @@ -32,4 +32,4 @@ struct add_lvalue_reference { template using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>; -#endif // _H_LIBCP_STL_ADD_LVALUE_REF +#endif // _H_LIBCX_STL_ADD_LVALUE_REF diff --git a/src/include/stl/add_rvalue_reference.hpp b/src/include/cx/stl/add_rvalue_reference.hpp similarity index 82% rename from src/include/stl/add_rvalue_reference.hpp rename to src/include/cx/stl/add_rvalue_reference.hpp index 07dd0d2..d99a547 100644 --- a/src/include/stl/add_rvalue_reference.hpp +++ b/src/include/cx/stl/add_rvalue_reference.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_ADD_RVALUE_REF -#define _H_LIBCP_STL_ADD_RVALUE_REF +#ifndef _H_LIBCX_STL_ADD_RVALUE_REF +#define _H_LIBCX_STL_ADD_RVALUE_REF -#include +#include #if __has_builtin(__add_rvalue_reference) @@ -33,4 +33,4 @@ struct add_rvalue_reference { template using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>; -#endif // _H_LIBCP_STL_ADD_RVALUE_REF +#endif // _H_LIBCX_STL_ADD_RVALUE_REF diff --git a/src/include/stl/derived_from.hpp b/src/include/cx/stl/derived_from.hpp similarity index 66% rename from src/include/stl/derived_from.hpp rename to src/include/cx/stl/derived_from.hpp index eac28ae..66d1234 100644 --- a/src/include/stl/derived_from.hpp +++ b/src/include/cx/stl/derived_from.hpp @@ -1,7 +1,7 @@ #ifndef _H_LIBCP_STL_DERIVED_FROM #define _H_LIBCP_STL_DERIVED_FROM -#include -#include +#include +#include template concept derived_from = is_base_of_v<_Bp, _Dp> && is_convertible_v; diff --git a/src/include/stl/integer_sequence.hpp b/src/include/cx/stl/integer_sequence.hpp similarity index 93% rename from src/include/stl/integer_sequence.hpp rename to src/include/cx/stl/integer_sequence.hpp index 20537d2..37d414f 100644 --- a/src/include/stl/integer_sequence.hpp +++ b/src/include/cx/stl/integer_sequence.hpp @@ -1,8 +1,8 @@ -#ifndef _H_LIBCP_STL_INTEGER_SEQUENCE -#define _H_LIBCP_STL_INTEGER_SEQUENCE +#ifndef _H_LIBCX_STL_INTEGER_SEQUENCE +#define _H_LIBCX_STL_INTEGER_SEQUENCE #include -#include +#include template struct __tuple_indices; @@ -64,4 +64,4 @@ constexpr void __for_each_index_sequence(index_sequence<_Index...>, _Function __ (__func.template operator()<_Index>(), ...); } -#endif // _H_LIBCP_STL_INTEGER_SEQUENCE +#endif // _H_LIBCX_STL_INTEGER_SEQUENCE diff --git a/src/include/stl/integral_constant.hpp b/src/include/cx/stl/integral_constant.hpp similarity index 82% rename from src/include/stl/integral_constant.hpp rename to src/include/cx/stl/integral_constant.hpp index 19c98b8..fe19773 100644 --- a/src/include/stl/integral_constant.hpp +++ b/src/include/cx/stl/integral_constant.hpp @@ -1,5 +1,5 @@ -#ifndef _H_LIBCP_STL_INTEGRAL_CONSTANT -#define _H_LIBCP_STL_INTEGRAL_CONSTANT +#ifndef _H_LIBCX_STL_INTEGRAL_CONSTANT +#define _H_LIBCX_STL_INTEGRAL_CONSTANT template struct integral_constant { @@ -25,4 +25,4 @@ using _BoolConstant = integral_constant; template using bool_constant = integral_constant; -#endif // _H_LIBCP_STL_INTEGRAL_CONSTANT \ No newline at end of file +#endif // _H_LIBCX_STL_INTEGRAL_CONSTANT \ No newline at end of file diff --git a/src/include/stl/is_base_of.hpp b/src/include/cx/stl/is_base_of.hpp similarity index 77% rename from src/include/stl/is_base_of.hpp rename to src/include/cx/stl/is_base_of.hpp index fc08320..cdde89e 100644 --- a/src/include/stl/is_base_of.hpp +++ b/src/include/cx/stl/is_base_of.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_IS_BASE_OF -#define _H_LIBCP_STL_IS_BASE_OF +#ifndef _H_LIBCX_STL_IS_BASE_OF +#define _H_LIBCX_STL_IS_BASE_OF -#include +#include template struct is_base_of : integral_constant {}; @@ -15,4 +15,4 @@ inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp); // template // inline constexpr bool is_virtual_base_of_v = __builtin_is_virtual_base_of(_Base, _Derived); -#endif // _H_LIBCP_STL_IS_BASE_OF \ No newline at end of file +#endif // _H_LIBCX_STL_IS_BASE_OF \ No newline at end of file diff --git a/src/include/stl/is_constructable.hpp b/src/include/cx/stl/is_constructable.hpp similarity index 78% rename from src/include/stl/is_constructable.hpp rename to src/include/cx/stl/is_constructable.hpp index f16d143..2ef7019 100644 --- a/src/include/stl/is_constructable.hpp +++ b/src/include/cx/stl/is_constructable.hpp @@ -1,9 +1,9 @@ -#ifndef _H_LIBCP_STL_IS_COPY_CONSTRUCTABLE -#define _H_LIBCP_STL_IS_COPY_CONSTRUCTABLE +#ifndef _H_LIBCX_STL_IS_COPY_CONSTRUCTABLE +#define _H_LIBCX_STL_IS_COPY_CONSTRUCTABLE -#include -#include -#include +#include +#include +#include template struct is_constructible : integral_constant {}; @@ -29,4 +29,4 @@ struct is_default_constructible : integral_constant inline constexpr bool is_default_constructible_v = __is_constructible(_Tp); -#endif // _H_LIBCP_STL_IS_COPY_CONSTRUCTABLE +#endif // _H_LIBCX_STL_IS_COPY_CONSTRUCTABLE diff --git a/src/include/stl/is_convertible.hpp b/src/include/cx/stl/is_convertible.hpp similarity index 75% rename from src/include/stl/is_convertible.hpp rename to src/include/cx/stl/is_convertible.hpp index ed43584..820fd36 100644 --- a/src/include/stl/is_convertible.hpp +++ b/src/include/cx/stl/is_convertible.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_IS_CONVERTIBLE -#define _H_LIBCP_STL_IS_CONVERTIBLE +#ifndef _H_LIBCX_STL_IS_CONVERTIBLE +#define _H_LIBCX_STL_IS_CONVERTIBLE -#include +#include template struct is_convertible : integral_constant {}; @@ -15,4 +15,4 @@ struct is_nothrow_convertible : bool_constant<__is_nothrow_convertible(_Tp, _Up) template inline constexpr bool is_nothrow_convertible_v = __is_nothrow_convertible(_Tp, _Up); -#endif // _H_LIBCP_STL_IS_CONVERTIBLE \ No newline at end of file +#endif // _H_LIBCX_STL_IS_CONVERTIBLE \ No newline at end of file diff --git a/src/include/stl/is_integral.hpp b/src/include/cx/stl/is_integral.hpp similarity index 93% rename from src/include/stl/is_integral.hpp rename to src/include/cx/stl/is_integral.hpp index b7ea0b1..863b251 100644 --- a/src/include/stl/is_integral.hpp +++ b/src/include/cx/stl/is_integral.hpp @@ -1,8 +1,8 @@ -#ifndef _H_LIBCP_STL_IS_INTEGRAL -#define _H_LIBCP_STL_IS_INTEGRAL +#ifndef _H_LIBCX_STL_IS_INTEGRAL +#define _H_LIBCX_STL_IS_INTEGRAL -#include -#include +#include +#include // clang-format off template struct __libcpp_is_integral { enum { value = 0 }; }; @@ -50,4 +50,4 @@ inline constexpr bool is_integral_v = is_integral<_Tp>::value; #endif // __has_builtin(__is_integral) -#endif // !_H_LIBCP_STL_IS_INTEGRAL +#endif // !_H_LIBCX_STL_IS_INTEGRAL diff --git a/src/include/stl/is_referenceable.hpp b/src/include/cx/stl/is_referenceable.hpp similarity index 63% rename from src/include/stl/is_referenceable.hpp rename to src/include/cx/stl/is_referenceable.hpp index 6af61e8..4566244 100644 --- a/src/include/stl/is_referenceable.hpp +++ b/src/include/cx/stl/is_referenceable.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_IS_REFERENCEABLE -#define _H_LIBCP_STL_IS_REFERENCEABLE +#ifndef _H_LIBCX_STL_IS_REFERENCEABLE +#define _H_LIBCX_STL_IS_REFERENCEABLE -#include +#include template inline const bool __is_referenceable_v = false; @@ -12,4 +12,4 @@ inline const bool __is_referenceable_v<_Tp, __void_t<_Tp&>> = true; template concept __referenceable = __is_referenceable_v<_Tp>; -#endif // !_H_LIBCP_STL_IS_REFERENCEABLE +#endif // !_H_LIBCX_STL_IS_REFERENCEABLE diff --git a/src/include/stl/is_same.hpp b/src/include/cx/stl/is_same.hpp similarity index 83% rename from src/include/stl/is_same.hpp rename to src/include/cx/stl/is_same.hpp index adc1fd1..64c23c7 100644 --- a/src/include/stl/is_same.hpp +++ b/src/include/cx/stl/is_same.hpp @@ -1,5 +1,5 @@ -#ifndef _H_LIBCP_STL_IS_SAME -#define _H_LIBCP_STL_IS_SAME +#ifndef _H_LIBCX_STL_IS_SAME +#define _H_LIBCX_STL_IS_SAME // Basic type trait template @@ -20,4 +20,4 @@ inline constexpr bool is_same_v = is_same::value; template concept same_as = is_same_v && is_same_v; -#endif // _H_LIBCP_STL_IS_SAME \ No newline at end of file +#endif // _H_LIBCX_STL_IS_SAME \ No newline at end of file diff --git a/src/include/stl/move.hpp b/src/include/cx/stl/move.hpp similarity index 51% rename from src/include/stl/move.hpp rename to src/include/cx/stl/move.hpp index 27aeb80..88e61a4 100644 --- a/src/include/stl/move.hpp +++ b/src/include/cx/stl/move.hpp @@ -1,11 +1,11 @@ -#ifndef _H_LIBCP_STL_MOVE -#define _H_LIBCP_STL_MOVE +#ifndef _H_LIBCX_STL_MOVE +#define _H_LIBCX_STL_MOVE -#include "stl/remove_reference.hpp" +#include template constexpr remove_reference_t&& move(T&& t) { return static_cast&&>(t); } -#endif // _H_LIBCP_STL_MOVE \ No newline at end of file +#endif // _H_LIBCX_STL_MOVE \ No newline at end of file diff --git a/src/include/stl/remove_cvref.hpp b/src/include/cx/stl/remove_cvref.hpp similarity index 80% rename from src/include/stl/remove_cvref.hpp rename to src/include/cx/stl/remove_cvref.hpp index 3441240..598fbc2 100644 --- a/src/include/stl/remove_cvref.hpp +++ b/src/include/cx/stl/remove_cvref.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STL_REMOVE_CVREF -#define _H_LIBCP_STL_REMOVE_CVREF +#ifndef _H_LIBCX_STL_REMOVE_CVREF +#define _H_LIBCX_STL_REMOVE_CVREF -#include +#include // For gcc // template @@ -25,4 +25,4 @@ struct remove_cvref { template using remove_cvref_t = __remove_cvref_t<_Tp>; -#endif // _H_LIBCP_STL_REMOVE_CVREF +#endif // _H_LIBCX_STL_REMOVE_CVREF diff --git a/src/include/stl/remove_reference.hpp b/src/include/cx/stl/remove_reference.hpp similarity index 73% rename from src/include/stl/remove_reference.hpp rename to src/include/cx/stl/remove_reference.hpp index ff9c093..9585a6d 100644 --- a/src/include/stl/remove_reference.hpp +++ b/src/include/cx/stl/remove_reference.hpp @@ -1,5 +1,5 @@ -#ifndef _H_LIBCP_STL_REMOVE_REFERENCE -#define _H_LIBCP_STL_REMOVE_REFERENCE +#ifndef _H_LIBCX_STL_REMOVE_REFERENCE +#define _H_LIBCX_STL_REMOVE_REFERENCE template struct remove_reference { @@ -19,4 +19,4 @@ struct remove_reference { template using remove_reference_t = typename remove_reference::type; -#endif // _H_LIBCP_STL_REMOVE_REFERENCE \ No newline at end of file +#endif // _H_LIBCX_STL_REMOVE_REFERENCE \ No newline at end of file diff --git a/src/include/stl/void_t.hpp b/src/include/cx/stl/void_t.hpp similarity index 50% rename from src/include/stl/void_t.hpp rename to src/include/cx/stl/void_t.hpp index 82a7ff6..93a0d19 100644 --- a/src/include/stl/void_t.hpp +++ b/src/include/cx/stl/void_t.hpp @@ -1,5 +1,5 @@ -#ifndef _H_LIBCP_STL_VOID_T -#define _H_LIBCP_STL_VOID_T +#ifndef _H_LIBCX_STL_VOID_T +#define _H_LIBCX_STL_VOID_T template using void_t = void; @@ -7,4 +7,4 @@ using void_t = void; template using __void_t = void; -#endif // !_H_LIBCP_STL_VOID_T +#endif // !_H_LIBCX_STL_VOID_T diff --git a/src/include/string.hpp b/src/include/cx/string.hpp similarity index 80% rename from src/include/string.hpp rename to src/include/cx/string.hpp index 703f250..25acfc9 100644 --- a/src/include/string.hpp +++ b/src/include/cx/string.hpp @@ -1,7 +1,7 @@ -#ifndef _H_LIBCP_STRING -#define _H_LIBCP_STRING +#ifndef _H_LIBCX_STRING +#define _H_LIBCX_STRING -#include "collections/vec.hpp" +#include class String { private: @@ -25,4 +25,4 @@ public: String clone(); }; -#endif // _H_LIBCP_STRING \ No newline at end of file +#endif // _H_LIBCX_STRING \ No newline at end of file diff --git a/src/include/sync/mutex.hpp b/src/include/cx/sync/mutex.hpp similarity index 92% rename from src/include/sync/mutex.hpp rename to src/include/cx/sync/mutex.hpp index 3589028..b9c0cc4 100644 --- a/src/include/sync/mutex.hpp +++ b/src/include/cx/sync/mutex.hpp @@ -1,6 +1,6 @@ -#ifndef _H_LIBCP_SYNC_MUTEX -#define _H_LIBCP_SYNC_MUTEX -#include +#ifndef _H_LIBCX_SYNC_MUTEX +#define _H_LIBCX_SYNC_MUTEX +#include #ifdef PLATFORM_LINUX #include @@ -74,4 +74,4 @@ public: } }; -#endif // !_H_LIBCP_SYNC_MUTEX +#endif // !_H_LIBCX_SYNC_MUTEX diff --git a/src/include/sync/spinlock.hpp b/src/include/cx/sync/spinlock.hpp similarity index 90% rename from src/include/sync/spinlock.hpp rename to src/include/cx/sync/spinlock.hpp index 5f1b6ce..f553e38 100644 --- a/src/include/sync/spinlock.hpp +++ b/src/include/cx/sync/spinlock.hpp @@ -1,6 +1,6 @@ -#ifndef _H_LIBCP_SYNC_SPINLOCK -#define _H_LIBCP_SYNC_SPINLOCK -#include +#ifndef _H_LIBCX_SYNC_SPINLOCK +#define _H_LIBCX_SYNC_SPINLOCK +#include #include template @@ -61,4 +61,4 @@ public: } }; -#endif // !_H_LIBCP_SYNC_SPINLOCK +#endif // !_H_LIBCX_SYNC_SPINLOCK diff --git a/src/include/format.hpp b/src/include/format.hpp deleted file mode 100644 index 6850be5..0000000 --- a/src/include/format.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _H_LIBCP_FORMAT -#define _H_LIBCP_FORMAT - -namespace format { -#include -} - -#endif // _H_LIBCP_FORMAT \ No newline at end of file diff --git a/src/include/io/fs.hpp b/src/include/io/fs.hpp deleted file mode 100644 index 7e750ff..0000000 --- a/src/include/io/fs.hpp +++ /dev/null @@ -1,15 +0,0 @@ - - -#ifndef _H_LIBCP_IO_FS -#define _H_LIBCP_IO_FS -namespace fs { - class File { - File() = default; - ~File() = default; - - void Open(); - }; -} - - -#endif // _H_LIBCP_IO_FS diff --git a/src/include/std.hpp b/src/include/std.hpp deleted file mode 100644 index 47ab38e..0000000 --- a/src/include/std.hpp +++ /dev/null @@ -1,13 +0,0 @@ - -#ifndef _H_LIBCP -#define _H_LIBCP - -#include -#include -#include -#include -#include -#include -#include - -#endif // _H_LIBCP \ No newline at end of file diff --git a/src/include/stl.hpp b/src/include/stl.hpp deleted file mode 100644 index 64faa50..0000000 --- a/src/include/stl.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _H_LIBCP_STL -#define _H_LIBCP_STL - -namespace stl { -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -} // namespace stl - -#endif // _H_LIBCP_STL \ No newline at end of file diff --git a/src/include/thirdparty/field_reflection_std.hpp b/src/include/thirdparty/field_reflection_std.hpp deleted file mode 100644 index f321344..0000000 --- a/src/include/thirdparty/field_reflection_std.hpp +++ /dev/null @@ -1,701 +0,0 @@ -/*===================================================* -| field-reflection version v0.2.1 | -| https://github.com/yosh-matsuda/field-reflection | -| | -| Copyright (c) 2024 Yoshiki Matsuda @yosh-matsuda | -| | -| This software is released under the MIT License. | -| https://opensource.org/license/mit/ | -====================================================*/ - -// Heavily modified by MCorange - -#pragma once - -#include -#include - -namespace field_reflection { - namespace detail { - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wundefined-inline" -#endif - template - struct any_lref { - template - requires(!stl::same_as) - constexpr operator U&() const&& noexcept; // NOLINT - template - requires(!stl::same_as) - constexpr operator U&() const& noexcept; // NOLINT - }; - - template - struct any_rref { - template - requires(!stl::same_as) - constexpr operator U() const&& noexcept; // NOLINT - }; - - template - struct any_lref_no_base { - template - requires(!stl::is_base_of_v && !stl::same_as) - constexpr operator U&() const&& noexcept; // NOLINT - template - requires(!stl::is_base_of_v && !stl::same_as) - constexpr operator U&() const& noexcept; // NOLINT - }; - - template - struct any_rref_no_base { - template - requires(!stl::is_base_of_v && !stl::same_as) - constexpr operator U() const&& noexcept; // NOLINT - }; - - template - struct any_lref_base { - template - requires stl::is_base_of_v - constexpr operator U&() const&& noexcept; // NOLINT - template - requires stl::is_base_of_v - constexpr operator U&() const& noexcept; // NOLINT - }; - - template - struct any_rref_base { - template - requires stl::is_base_of_v - constexpr operator U() const&& noexcept; // NOLINT - }; -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - - template - concept constructible = (ArgNum == 0 && requires { T{}; }) || [](stl::index_sequence) { - if constexpr (stl::is_copy_constructible_v) { - return requires { T{any_lref_no_base(), any_lref()...}; }; - } else { - return requires { T{any_rref_no_base(), any_rref()...}; }; - } - }(stl::make_index_sequence()); - - template - concept has_base = []() { - if constexpr (stl::is_copy_constructible_v) { - return requires { T{stl::declval>()}; }; - } else { - return requires { T{stl::declval>()}; }; - } - }(); - - constexpr size_t macro_max_fields_count = 100; - template - constexpr auto max_field_count = stl::min(size_t{macro_max_fields_count}, sizeof(T) * CHAR_BIT); // in consideration of bit field - - template - requires stl::is_aggregate_v - constexpr size_t field_count_impl = []() { - if constexpr (N >= max_field_count) { - return stl::numeric_limits::max(); - } else if constexpr (constructible && !constructible) { - return N; - } else { - return field_count_impl; - } - }(); - - template - requires stl::is_aggregate_v - constexpr size_t field_count_value = field_count_impl; - - template - concept field_countable = stl::is_aggregate_v && requires { requires field_count_value <= max_field_count; }; - - template - constexpr size_t field_count = field_count_value; - - template - concept field_referenceable = field_countable && (!has_base); - - template > - constexpr auto to_ptr_tuple(T&&) { - static_assert([] { return false; }(), "The supported maximum number of fields in struct must be <= 100."); - } - - template > - requires(field_count == 0) - constexpr auto to_ptr_tuple(T&&) { - return stl::tie(); - } - - template > - requires(field_count == 0) - constexpr auto to_tuple(T&&) { - return stl::tie(); - } - -#pragma region TO_TUPLE_TEMPLATE_MACRO -// map macro: https://github.com/swansontec/map-macro -#define FIELD_RFL_EVAL0(...) __VA_ARGS__ -#define FIELD_RFL_EVAL1(...) FIELD_RFL_EVAL0(FIELD_RFL_EVAL0(FIELD_RFL_EVAL0(__VA_ARGS__))) -#define FIELD_RFL_EVAL2(...) FIELD_RFL_EVAL1(FIELD_RFL_EVAL1(FIELD_RFL_EVAL1(__VA_ARGS__))) -#define FIELD_RFL_EVAL3(...) FIELD_RFL_EVAL2(FIELD_RFL_EVAL2(FIELD_RFL_EVAL2(__VA_ARGS__))) -#define FIELD_RFL_EVAL4(...) FIELD_RFL_EVAL3(FIELD_RFL_EVAL3(FIELD_RFL_EVAL3(__VA_ARGS__))) -#define FIELD_RFL_EVAL(...) FIELD_RFL_EVAL4(FIELD_RFL_EVAL4(FIELD_RFL_EVAL4(__VA_ARGS__))) - -#define FIELD_RFL_MAP_END(...) -#define FIELD_RFL_MAP_OUT -#define FIELD_RFL_MAP_COMMA , - -#define FIELD_RFL_MAP_GET_END2() 0, FIELD_RFL_MAP_END -#define FIELD_RFL_MAP_GET_END1(...) FIELD_RFL_MAP_GET_END2 -#define FIELD_RFL_MAP_GET_END(...) FIELD_RFL_MAP_GET_END1 -#define FIELD_RFL_MAP_NEXT0(test, next, ...) next FIELD_RFL_MAP_OUT -#define FIELD_RFL_MAP_NEXT1(test, next) FIELD_RFL_MAP_NEXT0(test, next, 0) -#define FIELD_RFL_MAP_NEXT(test, next) FIELD_RFL_MAP_NEXT1(FIELD_RFL_MAP_GET_END test, next) - -#define FIELD_RFL_MAP0(f, x, peek, ...) f(x) FIELD_RFL_MAP_NEXT(peek, FIELD_RFL_MAP1)(f, peek, __VA_ARGS__) -#define FIELD_RFL_MAP1(f, x, peek, ...) f(x) FIELD_RFL_MAP_NEXT(peek, FIELD_RFL_MAP0)(f, peek, __VA_ARGS__) - -#define FIELD_RFL_MAP_LIST_NEXT1(test, next) FIELD_RFL_MAP_NEXT0(test, FIELD_RFL_MAP_COMMA next, 0) -#define FIELD_RFL_MAP_LIST_NEXT(test, next) FIELD_RFL_MAP_LIST_NEXT1(FIELD_RFL_MAP_GET_END test, next) - -#define FIELD_RFL_MAP_LIST0(f, x, peek, ...) f(x) FIELD_RFL_MAP_LIST_NEXT(peek, FIELD_RFL_MAP_LIST1)(f, peek, __VA_ARGS__) -#define FIELD_RFL_MAP_LIST1(f, x, peek, ...) f(x) FIELD_RFL_MAP_LIST_NEXT(peek, FIELD_RFL_MAP_LIST0)(f, peek, __VA_ARGS__) -#define FIELD_RFL_MAP(f, ...) FIELD_RFL_EVAL(FIELD_RFL_MAP1(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) -#define FIELD_RFL_MAP_LIST(f, ...) FIELD_RFL_EVAL(FIELD_RFL_MAP_LIST1(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) - -#define FIELD_RFL_ADDR(x) &x -#define FIELD_RFL_DECLTYPE(x) decltype(x) -#define FIELD_RFL_FORWARD(x) stl::forward(x) - -#define TO_TUPLE_TEMPLATE(NUM, ...) \ - template > \ - requires(field_count == NUM) \ - constexpr auto to_ptr_tuple(T&& t) { \ - auto& [__VA_ARGS__] = t; \ - return stl::tuple(FIELD_RFL_MAP_LIST(FIELD_RFL_ADDR, __VA_ARGS__)); \ - } \ - template > \ - requires(field_count == NUM) \ - constexpr auto to_tuple(T&& t) { \ - auto [__VA_ARGS__] = stl::forward(t); \ - return stl::tuple(FIELD_RFL_MAP_LIST(FIELD_RFL_FORWARD, __VA_ARGS__)); \ - } - - TO_TUPLE_TEMPLATE(1, p0) - TO_TUPLE_TEMPLATE(2, p0, p1) - TO_TUPLE_TEMPLATE(3, p0, p1, p2) - TO_TUPLE_TEMPLATE(4, p0, p1, p2, p3) - TO_TUPLE_TEMPLATE(5, p0, p1, p2, p3, p4) - TO_TUPLE_TEMPLATE(6, p0, p1, p2, p3, p4, p5) - TO_TUPLE_TEMPLATE(7, p0, p1, p2, p3, p4, p5, p6) - TO_TUPLE_TEMPLATE(8, p0, p1, p2, p3, p4, p5, p6, p7) - TO_TUPLE_TEMPLATE(9, p0, p1, p2, p3, p4, p5, p6, p7, p8) - TO_TUPLE_TEMPLATE(10, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) - TO_TUPLE_TEMPLATE(11, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) - TO_TUPLE_TEMPLATE(12, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) - TO_TUPLE_TEMPLATE(13, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) - TO_TUPLE_TEMPLATE(14, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) - TO_TUPLE_TEMPLATE(15, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14) - TO_TUPLE_TEMPLATE(16, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) - TO_TUPLE_TEMPLATE(17, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) - TO_TUPLE_TEMPLATE(18, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) - TO_TUPLE_TEMPLATE(19, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) - TO_TUPLE_TEMPLATE(20, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) - TO_TUPLE_TEMPLATE(21, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) - TO_TUPLE_TEMPLATE(22, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) - TO_TUPLE_TEMPLATE(23, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22) - TO_TUPLE_TEMPLATE(24, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23) - TO_TUPLE_TEMPLATE(25, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24) - TO_TUPLE_TEMPLATE(26, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25) - TO_TUPLE_TEMPLATE(27, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26) - TO_TUPLE_TEMPLATE(28, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27) - TO_TUPLE_TEMPLATE(29, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28) - TO_TUPLE_TEMPLATE(30, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29) - TO_TUPLE_TEMPLATE(31, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30) - TO_TUPLE_TEMPLATE(32, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31) - TO_TUPLE_TEMPLATE(33, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32) - TO_TUPLE_TEMPLATE(34, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33) - TO_TUPLE_TEMPLATE(35, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34) - TO_TUPLE_TEMPLATE(36, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35) - TO_TUPLE_TEMPLATE(37, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36) - TO_TUPLE_TEMPLATE(38, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37) - TO_TUPLE_TEMPLATE(39, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38) - TO_TUPLE_TEMPLATE(40, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39) - TO_TUPLE_TEMPLATE(41, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40) - TO_TUPLE_TEMPLATE(42, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41) - TO_TUPLE_TEMPLATE(43, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42) - TO_TUPLE_TEMPLATE(44, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43) - TO_TUPLE_TEMPLATE(45, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44) - TO_TUPLE_TEMPLATE(46, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45) - TO_TUPLE_TEMPLATE(47, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46) - TO_TUPLE_TEMPLATE(48, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47) - TO_TUPLE_TEMPLATE(49, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48) - TO_TUPLE_TEMPLATE(50, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49) - TO_TUPLE_TEMPLATE(51, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50) - TO_TUPLE_TEMPLATE(52, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51) - TO_TUPLE_TEMPLATE(53, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52) - TO_TUPLE_TEMPLATE(54, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53) - TO_TUPLE_TEMPLATE(55, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54) - TO_TUPLE_TEMPLATE(56, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55) - TO_TUPLE_TEMPLATE(57, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56) - TO_TUPLE_TEMPLATE(58, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57) - TO_TUPLE_TEMPLATE(59, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58) - TO_TUPLE_TEMPLATE(60, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59) - TO_TUPLE_TEMPLATE(61, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60) - TO_TUPLE_TEMPLATE(62, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61) - TO_TUPLE_TEMPLATE(63, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62) - TO_TUPLE_TEMPLATE(64, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63) - TO_TUPLE_TEMPLATE(65, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64) - TO_TUPLE_TEMPLATE(66, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65) - TO_TUPLE_TEMPLATE(67, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66) - TO_TUPLE_TEMPLATE(68, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67) - TO_TUPLE_TEMPLATE(69, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68) - TO_TUPLE_TEMPLATE(70, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69) - TO_TUPLE_TEMPLATE(71, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70) - TO_TUPLE_TEMPLATE(72, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71) - TO_TUPLE_TEMPLATE(73, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72) - TO_TUPLE_TEMPLATE(74, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73) - TO_TUPLE_TEMPLATE(75, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74) - TO_TUPLE_TEMPLATE(76, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75) - TO_TUPLE_TEMPLATE(77, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76) - TO_TUPLE_TEMPLATE(78, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77) - TO_TUPLE_TEMPLATE(79, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78) - TO_TUPLE_TEMPLATE(80, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79) - TO_TUPLE_TEMPLATE(81, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80) - TO_TUPLE_TEMPLATE(82, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81) - TO_TUPLE_TEMPLATE(83, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82) - TO_TUPLE_TEMPLATE(84, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83) - TO_TUPLE_TEMPLATE(85, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84) - TO_TUPLE_TEMPLATE(86, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85) - TO_TUPLE_TEMPLATE(87, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86) - TO_TUPLE_TEMPLATE(88, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87) - TO_TUPLE_TEMPLATE(89, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88) - TO_TUPLE_TEMPLATE(90, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89) - TO_TUPLE_TEMPLATE(91, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90) - TO_TUPLE_TEMPLATE(92, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91) - TO_TUPLE_TEMPLATE(93, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92) - TO_TUPLE_TEMPLATE(94, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93) - TO_TUPLE_TEMPLATE(95, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94) - TO_TUPLE_TEMPLATE(96, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95) - TO_TUPLE_TEMPLATE(97, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96) - TO_TUPLE_TEMPLATE(98, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97) - TO_TUPLE_TEMPLATE(99, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98) - TO_TUPLE_TEMPLATE(100, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, - p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, - p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, - p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99) -#undef FIELD_RFL_EVAL0 -#undef FIELD_RFL_EVAL1 -#undef FIELD_RFL_EVAL2 -#undef FIELD_RFL_EVAL3 -#undef FIELD_RFL_EVAL4 -#undef FIELD_RFL_EVAL -#undef FIELD_RFL_MAP_END -#undef FIELD_RFL_MAP_OUT -#undef FIELD_RFL_MAP_COMMA -#undef FIELD_RFL_MAP_GET_END2 -#undef FIELD_RFL_MAP_GET_END1 -#undef FIELD_RFL_MAP_GET_END -#undef FIELD_RFL_MAP_NEXT0 -#undef FIELD_RFL_MAP_NEXT1 -#undef FIELD_RFL_MAP_NEXT -#undef FIELD_RFL_MAP0 -#undef FIELD_RFL_MAP1 -#undef FIELD_RFL_MAP_LIST_NEXT1 -#undef FIELD_RFL_MAP_LIST_NEXT -#undef FIELD_RFL_MAP_LIST0 -#undef FIELD_RFL_MAP_LIST1 -#undef FIELD_RFL_MAP -#undef FIELD_RFL_MAP_LIST -#undef FIELD_RFL_DECLTYPE -#undef FIELD_RFL_MOVE -#undef FIELD_RFL_TO_TUPLE_TEMPLATE -#pragma endregion TO_TUPLE_TEMPLATE_MACRO - -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundefined-internal" -#pragma clang diagnostic ignored "-Wundefined-var-template" -#elif defined(__GNUC__) -#elif defined(_MSC_VER) -#else -#endif - - template - struct wrapper { - explicit constexpr wrapper(const T& v) : value(v) {} - - T value; - static wrapper fake; // NOLINT - }; - - template // NOLINT - consteval auto get_ptr() noexcept { -#if defined(__clang__) - return wrapper(stl::get(to_ptr_tuple(wrapper::fake.value))); -#else - return stl::get(to_ptr_tuple(wrapper::fake.value)); -#endif - } - -#if defined(__clang__) -#pragma clang diagnostic pop -#elif __GNUC__ -#elif defined(_MSC_VER) -#else -#endif - - template - using nontype_template_parameter_helper = void; - - template // clang-format off - concept field_namable = field_referenceable && (field_count > 0) && requires { - typename nontype_template_parameter_helper()>; - }; // clang-format on - - template - consteval stl::string_view get_function_name() { -#if defined(__clang__) && defined(_WIN32) - // clang-cl returns function_name() as __FUNCTION__ instead of __PRETTY_FUNCTION__ - return stl::string_view{__PRETTY_FUNCTION__}; -#else - return stl::string_view{stl::source_location::current().function_name()}; -#endif - } - - template - consteval stl::string_view get_function_name() { -#if defined(__clang__) && defined(_WIN32) - // clang-cl returns function_name() as __FUNCTION__ instead of __PRETTY_FUNCTION__ - return stl::string_view{__PRETTY_FUNCTION__}; -#else - return stl::string_view{stl::source_location::current().function_name()}; -#endif - } - - template - consteval stl::string_view get_field_name() { - struct field_name_detector { - void* dummy; - }; - - constexpr auto detector_name = get_function_name()>(); - constexpr auto dummy_begin = detector_name.rfind(stl::string_view("dummy")); - constexpr auto suffix = detector_name.substr(dummy_begin + stl::string_view("dummy").size()); - constexpr auto begin_sentinel = detector_name[dummy_begin - 1]; - - const auto field_name_raw = get_function_name(); - const auto last = field_name_raw.rfind(suffix); - const auto begin = field_name_raw.rfind(begin_sentinel, last - 1) + 1; - - assert(begin < field_name_raw.size()); - assert(last <= field_name_raw.size()); - assert(begin < last); - - return field_name_raw.substr(begin, last - begin); - } - - template - using remove_rvalue_reference_t = stl::conditional_t, stl::remove_reference_t, T>; - - template - constexpr stl::string_view field_name = get_field_name()>(); - - template - using field_type = remove_rvalue_reference_t(to_tuple(stl::declval())))>; - - struct type_name_detector {}; - - template - consteval stl::string_view get_type_name() { -#if defined(__GNUC__) || defined(__clang__) - constexpr auto detector_name = get_function_name(); - constexpr auto dummy = stl::string_view("T = "); - constexpr auto dummy_begin = detector_name.find(dummy) + dummy.size(); - constexpr auto dummy2 = stl::string_view("type_name_detector"); - constexpr auto dummy_suffix_length = detector_name.size() - detector_name.find(dummy2) - dummy2.size(); - - constexpr auto type_name_raw = get_function_name(); - return type_name_raw.substr(dummy_begin, type_name_raw.size() - dummy_begin - dummy_suffix_length); -#else - constexpr auto detector_name = get_function_name(); - constexpr auto dummy = stl::string_view("struct field_reflection::detail::type_name_detector"); - constexpr auto dummy_begin = detector_name.find(dummy); - constexpr auto dummy_suffix_length = detector_name.size() - dummy_begin - dummy.size(); - - auto type_name_raw = get_function_name(); - auto type_name = type_name_raw.substr(dummy_begin, type_name_raw.size() - dummy_begin - dummy_suffix_length); - if (auto s = stl::string_view("struct "); type_name.starts_with(s)) { - type_name.remove_prefix(s.size()); - } - if (auto s = stl::string_view("class "); type_name.starts_with(s)) { - type_name.remove_prefix(s.size()); - } - return type_name; -#endif - } - - template - constexpr stl::string_view type_name = get_type_name(); - - template > - constexpr decltype(auto) get_field(T& t) noexcept { - return *stl::get(to_ptr_tuple(t)); - } - - template > - requires stl::is_rvalue_reference_v - constexpr auto get_field(T&& t) noexcept { - return stl::get(to_tuple(stl::forward(t))); - } - - template > - void for_each_field_impl(T&& t, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t)), ...); }) { - (func(get_field(t)), ...); - } else if constexpr (requires { (func(field_name, get_field(t)), ...); }) { - (func(field_name, get_field(t)), ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to for_each_field"); - } - } - - template > - void for_each_field_impl(T1&& t1, T2&& t2, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t1), get_field(t2)), ...); }) { - (func(get_field(t1), get_field(t2)), ...); - } else if constexpr (requires { (func(field_name, get_field(t1), get_field(t2)), ...); }) { - (func(field_name, get_field(t1), get_field(t2)), ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to for_each_field"); - } - } - - template > - bool all_of_field_impl(T&& t, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t)) && ...); }) { - return (func(get_field(t)) && ...); - } else if constexpr (requires { (func(field_name, get_field(t)) && ...); }) { - return (func(field_name, get_field(t)) && ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to all_of_field"); - } - } - - template > - bool all_of_field_impl(T1&& t1, T2&& t2, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t1), get_field(t2)) && ...); }) { - return (func(get_field(t1), get_field(t2)) && ...); - } else if constexpr (requires { (func(field_name, get_field(t1), get_field(t2)) && ...); }) { - return (func(field_name, get_field(t1), get_field(t2)) && ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to all_of_field"); - } - } - - template > - bool any_of_field_impl(T&& t, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t)) || ...); }) { - return (func(get_field(t)) || ...); - } else if constexpr (requires { (func(field_name, get_field(t)) || ...); }) { - return (func(field_name, get_field(t)) || ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to any_of_field"); - } - } - - template > - bool any_of_field_impl(T1&& t1, T2&& t2, Func&& func, stl::index_sequence) { - if constexpr (requires { (func(get_field(t1), get_field(t2)) || ...); }) { - return (func(get_field(t1), get_field(t2)) || ...); - } else if constexpr (requires { (func(field_name, get_field(t1), get_field(t2)) || ...); }) { - return (func(field_name, get_field(t1), get_field(t2)) || ...); - } else { - static_assert([] { return false; }(), "invalid function object for call to any_of_field"); - } - } - } // namespace detail - - using detail::field_count; - using detail::field_countable; - using detail::field_namable; - using detail::field_name; - using detail::field_referenceable; - using detail::field_type; - using detail::get_field; - using detail::to_tuple; - using detail::type_name; - - template , field_referenceable U2 = stl::remove_cvref_t> - requires stl::is_same_v - void for_each_field(T1&& t1, T2&& t2, Func&& func) { - detail::for_each_field_impl(stl::forward(t1), stl::forward(t2), stl::forward(func), stl::make_index_sequence>()); - } - - template > - void for_each_field(T&& t, Func&& func) { - detail::for_each_field_impl(stl::forward(t), stl::forward(func), stl::make_index_sequence>()); - } - - template , field_referenceable U2 = stl::remove_cvref_t> - requires stl::is_same_v - bool all_of_field(T1&& t1, T2&& t2, Func&& func) { - return detail::all_of_field_impl(stl::forward(t1), stl::forward(t2), stl::forward(func), stl::make_index_sequence>()); - } - - template > - bool all_of_field(T&& t, Func&& func) { - return detail::all_of_field_impl(stl::forward(t), stl::forward(func), stl::make_index_sequence>()); - } - - template , field_referenceable U2 = stl::remove_cvref_t> - requires stl::is_same_v - bool any_of_field(T1&& t1, T2&& t2, Func&& func) { - return detail::any_of_field_impl(stl::forward(t1), stl::forward(t2), stl::forward(func), stl::make_index_sequence>()); - } - - template > - bool any_of_field(T&& t, Func&& func) { - return detail::any_of_field_impl(stl::forward(t), stl::forward(func), stl::make_index_sequence>()); - } -} // namespace field_reflection diff --git a/src/internals.cpp b/src/internals.cpp index 54bbf25..641fdea 100644 --- a/src/internals.cpp +++ b/src/internals.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace std { void __glibcxx_assert_fail(char const* file, int line, char const* func, char const* info) { diff --git a/src/logger.cpp b/src/logger.cpp index 9a77abc..fcc09f1 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,6 +1,6 @@ -#include "io/print.hpp" +#include #include -#include +#include using namespace log; diff --git a/src/new.cpp b/src/new.cpp index a0f686d..33f0925 100644 --- a/src/new.cpp +++ b/src/new.cpp @@ -1,12 +1,9 @@ #include -#include /* for write(), also available on Windows */ +#include extern "C" void* emulate_cc_new(unsigned long len) { void* p = malloc(len); if (p == 0) { - /* Don't use stdio (e.g. fputs), because that may want to allocate more - * memory. - */ (void)!write(2, "out of memory\n", 14); abort(); } diff --git a/src/io/fs.cpp b/src/path.cpp similarity index 100% rename from src/io/fs.cpp rename to src/path.cpp diff --git a/src/string.cpp b/src/string.cpp index 2797580..56da6bc 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -1,5 +1,5 @@ #include -#include +#include String::String(const char* str) { this->_chars = Vec::from_ptr((char*)str, strlen(str)); diff --git a/test/test b/test/test index 47cc256..803aadc 100755 Binary files a/test/test and b/test/test differ diff --git a/test/test.cpp b/test/test.cpp index 117dbbe..ebf28de 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,13 +1,13 @@ -#include "io/print.hpp" -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include +#include struct Foo { int bar = 1;