2024-05-31 22:59:00 -04:00
|
|
|
#ifndef RFL_INTERNAL_HASFLATTENFIELDS_HPP_
|
|
|
|
#define RFL_INTERNAL_HASFLATTENFIELDS_HPP_
|
|
|
|
|
|
|
|
#include <tuple>
|
|
|
|
#include <type_traits>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "is_flatten_field.hpp"
|
|
|
|
|
|
|
|
namespace rfl {
|
2024-06-08 14:10:59 -04:00
|
|
|
namespace internal {
|
2024-05-31 22:59:00 -04:00
|
|
|
|
2024-06-08 14:10:59 -04:00
|
|
|
template <class TupleType, int _i = 0>
|
|
|
|
constexpr bool has_flatten_fields() {
|
|
|
|
if constexpr (_i == std::tuple_size_v<TupleType>) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
using T = std::remove_cvref_t<std::tuple_element_t<_i, TupleType>>;
|
|
|
|
return is_flatten_field_v<T> || has_flatten_fields<TupleType, _i + 1>();
|
|
|
|
}
|
|
|
|
}
|
2024-05-31 22:59:00 -04:00
|
|
|
|
2024-06-08 14:10:59 -04:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace rfl
|
2024-05-31 22:59:00 -04:00
|
|
|
|
|
|
|
#endif
|