diff --git a/include/rfl/internal/cpp20/Result.hpp b/include/rfl/internal/cpp20/Result.hpp index 6d516e4f0..fb436bedb 100644 --- a/include/rfl/internal/cpp20/Result.hpp +++ b/include/rfl/internal/cpp20/Result.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "../Error.hpp" #include "../always_inline.hpp" @@ -334,7 +335,7 @@ class Result { template RFL_ALWAYS_INLINE auto transform(const F& _f) && { /// Result_U is expected to be of type Result. - using U = std::invoke_result_t; + using U = decltype(std::declval()(std::declval())); if (success_) { return Result(_f(std::move(*this).get_t())); } else { @@ -549,9 +550,10 @@ class Result { * original value. */ template - Result transform_error(F&& f) && { - static_assert(std::is_same, Error>(), - "A function passed to transform_error must return an error."); + Result transform_error(F&& f) && { + static_assert( + std::is_same()(std::declval())), Error>(), + "A function passed to transform_error must return an error."); if (!has_value()) { return Result{std::invoke(f, std::move(*this).get_err())}; } else { @@ -577,9 +579,10 @@ class Result { * original value. */ template - Result transform_error(F&& f) const& { - static_assert(std::is_same, Error>(), - "A function passed to transform_error must return an error."); + Result transform_error(F&& f) const& { + static_assert( + std::is_same()(std::declval())), Error>(), + "A function passed to transform_error must return an error."); if (!has_value()) { return Result{std::invoke(f, get_err())}; } else { diff --git a/include/rfl/internal/nth_element_t.hpp b/include/rfl/internal/nth_element_t.hpp index 016a121fa..04719b588 100644 --- a/include/rfl/internal/nth_element_t.hpp +++ b/include/rfl/internal/nth_element_t.hpp @@ -1,6 +1,8 @@ #ifndef RFL_INTERNAL_NTH_ELEMENT_T_HPP_ #define RFL_INTERNAL_NTH_ELEMENT_T_HPP_ +#include + #include "nth_element.hpp" namespace rfl::internal { @@ -19,8 +21,8 @@ struct TypeWrapper { template using nth_element_t = - typename std::invoke_result_t...>), - TypeWrapper...>::Type; + decltype(nth_element...>( + std::declval>()...))::Type; #endif diff --git a/include/rfl/internal/processed_t.hpp b/include/rfl/internal/processed_t.hpp index 1e6250c5d..a2aee34cc 100644 --- a/include/rfl/internal/processed_t.hpp +++ b/include/rfl/internal/processed_t.hpp @@ -2,6 +2,7 @@ #define RFL_INTERNAL_PROCESSED_T_HPP_ #include +#include #include "../Processors.hpp" #include "ptr_named_tuple_t.hpp" @@ -16,9 +17,8 @@ template struct Processed> { using PtrNamedTupleType = ptr_named_tuple_t; using type = typename remove_ptrs_nt< - std::invoke_result_t::template process< - StructType, PtrNamedTupleType>), - PtrNamedTupleType>>::NamedTupleType; + decltype(Processors::template process( + std::declval()))>::NamedTupleType; }; template diff --git a/include/rfl/internal/ptr_named_tuple_t.hpp b/include/rfl/internal/ptr_named_tuple_t.hpp index e1b958084..626f79dc9 100644 --- a/include/rfl/internal/ptr_named_tuple_t.hpp +++ b/include/rfl/internal/ptr_named_tuple_t.hpp @@ -2,6 +2,7 @@ #define RFL_INTERNAL_PTR_FIELD_TUPLE_T_HPP_ #include +#include #include "to_ptr_named_tuple.hpp" @@ -9,7 +10,7 @@ namespace rfl::internal { template using ptr_named_tuple_t = - std::invoke_result_t), T>; + decltype(to_ptr_named_tuple(std::declval())); } // namespace rfl::internal diff --git a/include/rfl/internal/tag_t.hpp b/include/rfl/internal/tag_t.hpp index 4ce5e0d1d..bc0bf7d08 100644 --- a/include/rfl/internal/tag_t.hpp +++ b/include/rfl/internal/tag_t.hpp @@ -2,6 +2,7 @@ #define RFL_INTERNAL_TAG_T_HPP_ #include +#include #include "StringLiteral.hpp" #include "make_tag.hpp" @@ -9,7 +10,7 @@ namespace rfl::internal { template -using tag_t = std::invoke_result_t), T>; +using tag_t = decltype(make_tag<_discriminator, T>(std::declval())); } // namespace rfl::internal diff --git a/include/rfl/internal/variant/result_t.hpp b/include/rfl/internal/variant/result_t.hpp index a906c5af1..78af725b6 100644 --- a/include/rfl/internal/variant/result_t.hpp +++ b/include/rfl/internal/variant/result_t.hpp @@ -2,14 +2,16 @@ #define RFL_INTERNAL_VARIANT_RESULT_T_HPP_ #include +#include #include "../nth_element_t.hpp" namespace rfl::internal::variant { template -using result_t = std::remove_cv_t, internal::nth_element_t<0, AlternativeTypes...>&>>; +using result_t = std::remove_cv_t>()( + std::declval&>()))>; } // namespace rfl::internal::variant diff --git a/include/rfl/parsing/ParserTaggedUnion.hpp b/include/rfl/parsing/ParserTaggedUnion.hpp index 0e9c6dc81..dee232752 100644 --- a/include/rfl/parsing/ParserTaggedUnion.hpp +++ b/include/rfl/parsing/ParserTaggedUnion.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "../Result.hpp" #include "../TaggedUnion.hpp" @@ -128,8 +129,9 @@ struct ParserTaggedUnion, return Parser, ProcessorsType>::to_schema(_definitions); } else { - using VariantType = std::variant), AlternativeTypes>...>; + using VariantType = std::variant(std::declval())) + ...>; return Parser::to_schema(_definitions); } } @@ -191,8 +193,9 @@ struct ParserTaggedUnion, return wrap_error(stream.str(), std::move(_e)); }; - using T = tagged_union_wrapper_no_ptr_t), AlternativeType>>; + using T = tagged_union_wrapper_no_ptr_t(std::declval() + ))>; *_result = Parser::read(_r, _var) .transform(get_fields) diff --git a/include/rfl/parsing/TupleReader.hpp b/include/rfl/parsing/TupleReader.hpp index dab0c7fdf..9d0fcddef 100644 --- a/include/rfl/parsing/TupleReader.hpp +++ b/include/rfl/parsing/TupleReader.hpp @@ -33,8 +33,6 @@ class TupleReader { TupleReader(const R* _r, TupleType* _tuple) : num_set_(0), r_(_r), tuple_(_tuple) {} - ~TupleReader() = default; - /** * @brief Handles any fields that were missing from the input. * diff --git a/include/rfl/parsing/VariantAlternativeWrapper.hpp b/include/rfl/parsing/VariantAlternativeWrapper.hpp index 208589c27..029afc456 100644 --- a/include/rfl/parsing/VariantAlternativeWrapper.hpp +++ b/include/rfl/parsing/VariantAlternativeWrapper.hpp @@ -2,6 +2,7 @@ #define RFL_PARSING_VARIANTALTERNATIVEWRAPPER_HPP_ #include +#include #include "../Field.hpp" #include "../Literal.hpp" @@ -44,8 +45,8 @@ consteval auto make_tag() { } template -using tag_t = std::invoke_result_t< - decltype(make_tag>, _remove_namespaces>)>; +using tag_t = decltype(make_tag>, + _remove_namespaces>()); } // namespace vaw diff --git a/include/rfl/view_t.hpp b/include/rfl/view_t.hpp index c1c7569df..0896c1018 100644 --- a/include/rfl/view_t.hpp +++ b/include/rfl/view_t.hpp @@ -2,6 +2,7 @@ #define RFL_VIEW_T_HPP_ #include +#include #include "Processors.hpp" #include "internal/ptr_named_tuple_t.hpp" @@ -10,10 +11,9 @@ namespace rfl { /// Generates the named tuple that would be the result of to_view template -using view_t = - std::invoke_result_t::template process< - T, internal::ptr_named_tuple_t>), - internal::ptr_named_tuple_t>; +using view_t = decltype(Processors::template process< + T, internal::ptr_named_tuple_t>( + std::declval>())); } // namespace rfl diff --git a/vcpkg b/vcpkg index 0e5030f58..93ad765c7 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 0e5030f583a5427123cd3b714255e5ae62faa3ba +Subproject commit 93ad765c7b66ab9ce97469ec23a90b15c3a14ee5