diff --git a/docs/c_arrays_and_inheritance.md b/docs/c_arrays_and_inheritance.md index 0d45e1e8..3f39dd1b 100644 --- a/docs/c_arrays_and_inheritance.md +++ b/docs/c_arrays_and_inheritance.md @@ -12,7 +12,7 @@ inheritance altogether. Note that C arrays are not the same thing as `std::array`. `std::array` is always supported and is the recommended alternative. -If you want support for these, you will have to pass the flag `-D REFLECTCPP_C_ARRAYS_OR_INHERITANCE` +If you want support for these, you will have to pass the flag `-D REFLECT_CPP_C_ARRAYS_OR_INHERITANCE` during compilation. ## C arrays diff --git a/include/rfl/internal/num_fields.hpp b/include/rfl/internal/num_fields.hpp index 29146b6d..fdff100e 100644 --- a/include/rfl/internal/num_fields.hpp +++ b/include/rfl/internal/num_fields.hpp @@ -53,22 +53,23 @@ template struct any_empty_base { any_empty_base(std::size_t); template - requires(std::is_empty_v>&& std::is_base_of_v< - std::remove_cvref_t, std::remove_cv_t> && - !std::is_same_v, - std::remove_cv_t>) constexpr - operator Base&() const noexcept; + requires( + std::is_empty_v> && + std::is_base_of_v, + std::remove_cv_t> && + !std::is_same_v, std::remove_cv_t>) + constexpr operator Base&() const noexcept; }; template struct any_base { any_base(std::size_t); template - requires( - std::is_base_of_v, std::remove_cv_t> && - !std::is_same_v, - std::remove_cv_t>) constexpr - operator Base&() const noexcept; + requires( + std::is_base_of_v, + std::remove_cv_t> && + !std::is_same_v, std::remove_cv_t>) + constexpr operator Base&() const noexcept; }; struct any { @@ -83,19 +84,17 @@ struct CountFieldsHelper { static consteval bool constructible() { return [](std::index_sequence) { return requires { T{any(is)...}; }; - } - (std::make_index_sequence()); + }(std::make_index_sequence()); } template static consteval bool constructible_with_nested() { return []( - std::index_sequence, std::index_sequence, - std::index_sequence) { + std::index_sequence, std::index_sequence, + std::index_sequence) { return requires { T{any(i)..., {any(j)...}, any(k)...}; }; - } - (std::make_index_sequence(), std::make_index_sequence(), - std::make_index_sequence()); + }(std::make_index_sequence(), std::make_index_sequence(), + std::make_index_sequence()); } template @@ -124,7 +123,8 @@ struct CountFieldsHelper { static consteval std::size_t find_the_sole_non_empty_base_index() { static_assert(index < max_args); constexpr auto check = []( - std::index_sequence, std::index_sequence) { + std::index_sequence, + std::index_sequence) { return requires { T{any_empty_base(l)..., any_base(0), any_empty_base(r)...}; }; @@ -155,8 +155,7 @@ struct CountFieldsHelper { return [](std::index_sequence, std::index_sequence) { return requires { T{any_base(l)..., any(r)...}; }; - } - (std::make_index_sequence(), std::make_index_sequence()); + }(std::make_index_sequence(), std::make_index_sequence()); } template @@ -182,7 +181,8 @@ struct CountFieldsHelper { static consteval std::size_t count_fields() { constexpr std::size_t max_agg_args = count_max_args_in_agg_init(); -#ifdef REFLECT_CPP_C_ARRAYS_OR_INHERITANCE +#if defined(REFLECT_CPP_C_ARRAYS_OR_INHERITANCE) || \ + defined(REFLECTCPP_C_ARRAYS_OR_INHERITANCE) constexpr std::size_t no_brace_ellison_args = constructible_no_brace_elision<0, max_agg_args>(); constexpr std::size_t base_args = base_param_num();