Skip to content

Commit

Permalink
Try to fix old clang
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Nov 2, 2024
1 parent b61c9e5 commit 04cc827
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/base/refl/auto_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ constexpr std::pair<const std::string_view, Accessor<Object>>
#endif
};

template <class T>
using IsSerializableT = std::bool_constant<IsSerializable<T>>;

template <class Object,
class Members =
#ifndef __clang_analyzer__
std::remove_cvref_t<decltype(all_member_functor_v<Object,
[]<class T>()
{
return IsSerializable<T>;
}>)>
std::remove_cvref_t<
decltype(all_member_functor_v<Object, IsSerializableT>)>
#else
std::tuple<>
#endif
Expand Down
15 changes: 4 additions & 11 deletions src/base/refl/auto_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,31 +679,24 @@ concept is_reflectable =
|| (std::is_aggregate_v<T>
&& is_structure_bindable_v<T> != structure_bindable::no);

template <class T, auto L, class... PreMPs>
template <class T, template <class> class Checker, class... PreMPs>
constexpr static auto all_member_functor_v{
[]<class... Bases, class... MF>(std::tuple<Bases...> *,
std::tuple<MF...>)
{
if constexpr (L.template operator()<T>()) {
if constexpr (Checker<T>::value) {
return std::tuple<std::tuple<PreMPs...>>{};
}
else if constexpr (is_reflectable<T>) {
return decltype(std::tuple_cat(
all_member_functor_v<Bases, L, PreMPs...>...,
all_member_functor_v<Bases, Checker, PreMPs...>...,
all_member_functor_v<member_functor_t<MF>,
L,
Checker,
PreMPs...,
MF>...)){};
}
}(std::add_pointer_t<bases_t<T>>{}, member_functors_v<T>)};

template <class T, auto L, class... PreMPs>
constexpr static std::tuple<std::tuple<PreMPs...>>
all_member_functor_v<T,
L,
std::enable_if_t<L.template operator()<T>()>,
PreMPs...>{};

namespace Functors
{
namespace Composite
Expand Down

0 comments on commit 04cc827

Please sign in to comment.