Skip to content

Commit

Permalink
another try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Oct 31, 2024
1 parent e7b5d34 commit b61c9e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
21 changes: 12 additions & 9 deletions src/base/refl/auto_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,19 +679,22 @@ concept is_reflectable =
|| (std::is_aggregate_v<T>
&& is_structure_bindable_v<T> != structure_bindable::no);

template <class T, auto L, class = void, class... PreMPs>
template <class T, auto L, class... PreMPs>
constexpr static auto all_member_functor_v{
[]<class... Bases, class... MF>(std::tuple<Bases...> *,
std::tuple<MF...>)
{
static_assert(is_reflectable<T>, "Unable to run reflection");
return decltype(std::tuple_cat(
all_member_functor_v<Bases, L, void, PreMPs...>...,
all_member_functor_v<member_functor_t<MF>,
L,
void,
PreMPs...,
MF>...)){};
if constexpr (L.template operator()<T>()) {
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<member_functor_t<MF>,
L,
PreMPs...,
MF>...)){};
}
}(std::add_pointer_t<bases_t<T>>{}, member_functors_v<T>)};

template <class T, auto L, class... PreMPs>
Expand Down
12 changes: 7 additions & 5 deletions src/chart/options/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ ChannelSeriesList::FromString::operator()(
default:
case Parse::null: break;
case Parse::name:
if (res && !res->isDimension())
res = Data::SeriesIndex{str, *table}.setAggr(
res->getAggr());
else if (!str.empty())
res.emplace(str, *table);
if (!str.empty()) {
if (res && !res->isDimension())
res = Data::SeriesIndex{str, *table}.setAggr(
res->getAggr());
else
res.emplace(str, *table);
}
break;
case Parse::aggregator:
if (res)
Expand Down

0 comments on commit b61c9e5

Please sign in to comment.