fix clang ci compilation

This commit is contained in:
BlackMATov
2022-02-05 07:28:32 +07:00
parent fd0d5ed4b2
commit 4180e35df5
8 changed files with 80 additions and 52 deletions

View File

@@ -13,6 +13,9 @@ add_library(${PROJECT_NAME} INTERFACE)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20) target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
target_include_directories(${PROJECT_NAME} INTERFACE headers) target_include_directories(${PROJECT_NAME} INTERFACE headers)
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
target_compile_options(${PROJECT_NAME} target_compile_options(${PROJECT_NAME}
INTERFACE INTERFACE
$<$<CXX_COMPILER_ID:MSVC>: $<$<CXX_COMPILER_ID:MSVC>:

View File

@@ -11,15 +11,18 @@
namespace meta_hpp::detail namespace meta_hpp::detail
{ {
template < typename T > template < typename T >
concept state_family = inline constexpr bool is_state_family_v =
stdex::same_as<T, ctor> || std::is_same_v<T, ctor> ||
stdex::same_as<T, dtor> || std::is_same_v<T, dtor> ||
stdex::same_as<T, evalue> || std::is_same_v<T, evalue> ||
stdex::same_as<T, function> || std::is_same_v<T, function> ||
stdex::same_as<T, member> || std::is_same_v<T, member> ||
stdex::same_as<T, method> || std::is_same_v<T, method> ||
stdex::same_as<T, scope> || std::is_same_v<T, scope> ||
stdex::same_as<T, variable>; std::is_same_v<T, variable>;
template < typename T >
concept state_family = is_state_family_v<T>;
template < state_family T > template < state_family T >
[[nodiscard]] auto state_access(const T& state) { [[nodiscard]] auto state_access(const T& state) {

View File

@@ -11,21 +11,24 @@
namespace meta_hpp::detail namespace meta_hpp::detail
{ {
template < typename T > template < typename T >
concept type_family = inline constexpr bool is_type_family_v =
stdex::same_as<T, any_type> || std::is_same_v<T, any_type> ||
stdex::same_as<T, array_type> || std::is_same_v<T, array_type> ||
stdex::same_as<T, class_type> || std::is_same_v<T, class_type> ||
stdex::same_as<T, ctor_type> || std::is_same_v<T, ctor_type> ||
stdex::same_as<T, dtor_type> || std::is_same_v<T, dtor_type> ||
stdex::same_as<T, enum_type> || std::is_same_v<T, enum_type> ||
stdex::same_as<T, function_type> || std::is_same_v<T, function_type> ||
stdex::same_as<T, member_type> || std::is_same_v<T, member_type> ||
stdex::same_as<T, method_type> || std::is_same_v<T, method_type> ||
stdex::same_as<T, nullptr_type> || std::is_same_v<T, nullptr_type> ||
stdex::same_as<T, number_type> || std::is_same_v<T, number_type> ||
stdex::same_as<T, pointer_type> || std::is_same_v<T, pointer_type> ||
stdex::same_as<T, reference_type> || std::is_same_v<T, reference_type> ||
stdex::same_as<T, void_type>; std::is_same_v<T, void_type>;
template < typename T >
concept type_family = is_type_family_v<T>;
template < type_family T > template < type_family T >
[[nodiscard]] auto type_access(const T& type) { [[nodiscard]] auto type_access(const T& type) {

View File

@@ -12,12 +12,15 @@
namespace meta_hpp::detail namespace meta_hpp::detail
{ {
template < typename T > template < typename T >
concept uvalue_kind = inline constexpr bool is_uvalue_kind_v =
stdex::same_as<T, arg_base> || std::is_same_v<T, arg_base> ||
stdex::same_as<T, arg> || std::is_same_v<T, arg> ||
stdex::same_as<T, inst_base> || std::is_same_v<T, inst_base> ||
stdex::same_as<T, inst> || std::is_same_v<T, inst> ||
stdex::same_as<T, value>; std::is_same_v<T, value>;
template < typename T >
concept uvalue_kind = is_uvalue_kind_v<T>;
template < typename T > template < typename T >
concept decay_uvalue_kind = uvalue_kind<std::decay_t<T>>; concept decay_uvalue_kind = uvalue_kind<std::decay_t<T>>;

View File

@@ -51,34 +51,49 @@ namespace meta_hpp
} }
template < typename Policy > template < typename Policy >
concept ctor_policy_kind = inline constexpr bool is_ctor_policy_v =
stdex::same_as<Policy, ctor_policy::as_object> || std::is_same_v<Policy, ctor_policy::as_object> ||
stdex::same_as<Policy, ctor_policy::as_raw_pointer> || std::is_same_v<Policy, ctor_policy::as_raw_pointer> ||
stdex::same_as<Policy, ctor_policy::as_shared_pointer>; std::is_same_v<Policy, ctor_policy::as_shared_pointer>;
template < typename Policy > template < typename Policy >
concept function_policy_kind = inline constexpr bool is_function_policy_v =
stdex::same_as<Policy, function_policy::as_copy> || std::is_same_v<Policy, function_policy::as_copy> ||
stdex::same_as<Policy, function_policy::discard_return> || std::is_same_v<Policy, function_policy::discard_return> ||
stdex::same_as<Policy, function_policy::return_reference_as_pointer>; std::is_same_v<Policy, function_policy::return_reference_as_pointer>;
template < typename Policy > template < typename Policy >
concept member_policy_kind = inline constexpr bool is_member_policy_v =
stdex::same_as<Policy, member_policy::as_copy> || std::is_same_v<Policy, member_policy::as_copy> ||
stdex::same_as<Policy, member_policy::as_pointer> || std::is_same_v<Policy, member_policy::as_pointer> ||
stdex::same_as<Policy, member_policy::as_reference_wrapper>; std::is_same_v<Policy, member_policy::as_reference_wrapper>;
template < typename Policy > template < typename Policy >
concept method_policy_kind = inline constexpr bool is_method_policy_v =
stdex::same_as<Policy, method_policy::as_copy> || std::is_same_v<Policy, method_policy::as_copy> ||
stdex::same_as<Policy, method_policy::discard_return> || std::is_same_v<Policy, method_policy::discard_return> ||
stdex::same_as<Policy, method_policy::return_reference_as_pointer>; std::is_same_v<Policy, method_policy::return_reference_as_pointer>;
template < typename Policy > template < typename Policy >
concept variable_policy_kind = inline constexpr bool is_variable_policy_v =
stdex::same_as<Policy, variable_policy::as_copy> || std::is_same_v<Policy, variable_policy::as_copy> ||
stdex::same_as<Policy, variable_policy::as_pointer> || std::is_same_v<Policy, variable_policy::as_pointer> ||
stdex::same_as<Policy, variable_policy::as_reference_wrapper>; std::is_same_v<Policy, variable_policy::as_reference_wrapper>;
template < typename Policy >
concept ctor_policy_kind = is_ctor_policy_v<Policy>;
template < typename Policy >
concept function_policy_kind = is_function_policy_v<Policy>;
template < typename Policy >
concept member_policy_kind = is_member_policy_v<Policy>;
template < typename Policy >
concept method_policy_kind = is_method_policy_v<Policy>;
template < typename Policy >
concept variable_policy_kind = is_variable_policy_v<Policy>;
} }
namespace meta_hpp namespace meta_hpp

View File

@@ -18,7 +18,7 @@ endif()
file(GLOB_RECURSE MANUALS_SOURCES "*.cpp" "*.hpp") file(GLOB_RECURSE MANUALS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${MANUALS_SOURCES}) add_executable(${PROJECT_NAME} ${MANUALS_SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE meta.hpp doctest_with_main fmt) target_link_libraries(${PROJECT_NAME} PRIVATE meta.hpp doctest_with_main fmt-header-only)
target_compile_options(${PROJECT_NAME} target_compile_options(${PROJECT_NAME}
PRIVATE PRIVATE

View File

@@ -9,6 +9,7 @@
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++20-compat"
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command" #pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
#pragma clang diagnostic ignored "-Wsigned-enum-bitfield" #pragma clang diagnostic ignored "-Wsigned-enum-bitfield"
#pragma clang diagnostic ignored "-Wswitch-enum" #pragma clang diagnostic ignored "-Wswitch-enum"

View File

@@ -18,7 +18,7 @@ endif()
file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp") file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES}) add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE meta.hpp doctest_with_main fmt) target_link_libraries(${PROJECT_NAME} PRIVATE meta.hpp doctest_with_main fmt-header-only)
target_compile_options(${PROJECT_NAME} target_compile_options(${PROJECT_NAME}
PRIVATE PRIVATE