Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/rfl/internal/bind_to_tuple.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef RFL_INTERNAL_BIND_TO_TUPLE_HPP_
#define RFL_INTERNAL_BIND_TO_TUPLE_HPP_

#include <cassert>
#include <cstddef>
#include <iostream>
#include <tuple>
#include <type_traits>
#include <utility>

Expand Down Expand Up @@ -42,8 +42,8 @@ struct tuple_view_helper<0> {
n, ...) \
template <> \
struct tuple_view_helper<n> { \
static auto tuple_view(auto& t) { \
auto& [__VA_ARGS__] = t; \
static auto tuple_view(auto& _t) { \
auto& [__VA_ARGS__] = _t; \
return [](auto&... _refs) { \
return rfl::make_tuple(&_refs...); \
}(__VA_ARGS__); \
Expand Down Expand Up @@ -2822,13 +2822,13 @@ RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS(
#undef RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS

template <class T>
auto tuple_view(T& t) {
return tuple_view_helper<num_fields<T>>::tuple_view(t);
auto bind_to_tuple(T& _t) {
return tuple_view_helper<num_fields<T>>::tuple_view(_t);
}

template <class T, typename F>
auto bind_to_tuple(T& _t, const F& _f) {
auto view = tuple_view(_t);
auto view = bind_to_tuple(_t);
return [&]<std::size_t... _is>(std::index_sequence<_is...>) {
return rfl::make_tuple(_f(rfl::get<_is>(view))...);
}
Expand Down
6 changes: 3 additions & 3 deletions include/rfl/internal/to_flattened_ptr_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ namespace internal {

template <class PtrTuple>
auto flatten_ptr_tuple(PtrTuple&& _t) {
if constexpr (0 && !has_flatten_fields<PtrTuple>()) {
if constexpr (!has_flatten_fields<PtrTuple>()) {
return std::forward<PtrTuple>(_t);
} else {
const auto get_one = [&]<int _i>(std::integral_constant<int, _i>) {
using T = tuple_element_t<_i, std::remove_cvref_t<PtrTuple>>;
if constexpr (is_flatten_field_v<T>) {
return flatten_ptr_tuple(to_ptr_tuple(std::get<_i>(_t)->get()));
return flatten_ptr_tuple(to_ptr_tuple(rfl::get<_i>(_t)->get()));
} else {
return rfl::make_tuple(std::get<_i>(_t));
return rfl::make_tuple(rfl::get<_i>(_t));
}
};

Expand Down
2 changes: 1 addition & 1 deletion include/rfl/internal/to_ptr_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ auto to_ptr_tuple(T& _t) {
if constexpr (std::is_pointer_v<std::remove_cvref_t<T>>) {
return to_ptr_tuple(*_t);
} else {
return bind_to_tuple(_t, [](auto* _ptr) { return _ptr; });
return bind_to_tuple(_t);
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/rfl/parsing/Parser_default.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ struct Parser {
const InputVarType& _var) {
auto t = T{};
auto view = ProcessorsType::template process<T>(to_view(t));
using ViewType = std::remove_cvref_t<decltype(view)>;
using ViewType = decltype(view);
const auto err =
Parser<R, W, ViewType, ProcessorsType>::read_view_with_default(_r, _var,
&view);
Expand Down
1 change: 1 addition & 0 deletions include/rfl/to_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define RFL_TO_VIEW_HPP_

#include <iostream>
#include <stdexcept>
#include <tuple>
#include <type_traits>

Expand Down
Loading