Skip to content

Commit

Permalink
Actually using strict deducers in strict_fixed_injector
Browse files Browse the repository at this point in the history
  • Loading branch information
gracicot committed Aug 6, 2024
1 parent 94965c4 commit f0e755a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/kangaru/detail/injector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,33 +155,33 @@ namespace kangaru {
explicit constexpr strict_fixed_injector(Source source) noexcept : source{std::move(source)} {}

constexpr auto operator()(auto&& function) & -> decltype(auto)
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), basic_deducer<Source&>, std::make_index_sequence<N>>
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), strict_deducer<Source&>, std::make_index_sequence<N>>
{
return expand_deducers(std::make_index_sequence<N>{}, KANGARU5_FWD(function), source);
}

constexpr auto operator()(auto&& function) const& -> decltype(auto)
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), basic_deducer<Source const&>, std::make_index_sequence<N>>
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), strict_deducer<Source const&>, std::make_index_sequence<N>>
{
return expand_deducers(std::make_index_sequence<N>{}, KANGARU5_FWD(function), source);
}

constexpr auto operator()(auto&& function) && -> decltype(auto)
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), basic_deducer<Source&&>, std::make_index_sequence<N>>
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), strict_deducer<Source&&>, std::make_index_sequence<N>>
{
return expand_deducers(std::make_index_sequence<N>{}, KANGARU5_FWD(function), std::move(source));
}

constexpr auto operator()(auto&& function) const&& -> decltype(auto)
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), basic_deducer<Source const&&>, std::make_index_sequence<N>>
requires detail::injector::invocable_with_strict_deducer_sequence<decltype(function), strict_deducer<Source const&&>, std::make_index_sequence<N>>
{
return expand_deducers(std::make_index_sequence<N>{}, KANGARU5_FWD(function), std::move(source));
}

private:
template<std::size_t... s>
static constexpr auto expand_deducers(std::index_sequence<s...>, auto&& function, auto&& source) -> decltype(auto) {
using Deducer = basic_deducer<decltype(source)>;
using Deducer = strict_deducer<decltype(source)>;
return kangaru::invoke_with_strict_deducers(KANGARU5_FWD(function), (void(s), Deducer{KANGARU5_FWD(source)})...);
}

Expand Down

0 comments on commit f0e755a

Please sign in to comment.