Skip to content

Commit c277294

Browse files
committed
hybrid_adapter: fix infinite recursion error with Clang
1 parent 04bd732 commit c277294

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/cpp-sort/adapters/hybrid_adapter.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ namespace cppsort
9595

9696
template<typename Self, typename... Args>
9797
constexpr auto operator()(this Self&& self, choice<Ind>, Args&&... args)
98-
-> decltype(std::forward<Self>(self).base_class::get()(std::forward<Args>(args)...))
98+
-> decltype(static_cast<detail::copy_cvref_t<Self, base_class>>(self).get()(std::forward<Args>(args)...))
9999
{
100-
return std::forward<Self>(self).base_class::get()(std::forward<Args>(args)...);
100+
return static_cast<detail::copy_cvref_t<Self, base_class>>(self).get()(std::forward<Args>(args)...);
101101
}
102102

103103
template<typename... Args>
@@ -214,13 +214,13 @@ namespace cppsort
214214
template<typename Self, mstd::forward_range Range, typename... Args>
215215
requires are_parameters_valid<mstd::iterator_t<Range>, Args...>
216216
constexpr auto operator()(this Self&& self, Range&& range, Args&&... args)
217-
-> decltype(std::forward<Self>(self).base_class::operator()(
217+
-> decltype(static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
218218
detail::choice_for_it<mstd::iterator_t<Range>, sizeof...(Sorters)>{},
219219
std::forward<Range>(range),
220220
std::forward<Args>(args)...
221221
))
222222
{
223-
return std::forward<Self>(self).base_class::operator()(
223+
return static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
224224
detail::choice_for_it<mstd::iterator_t<Range>, sizeof...(Sorters)>{},
225225
std::forward<Range>(range),
226226
std::forward<Args>(args)...
@@ -235,13 +235,13 @@ namespace cppsort
235235
>
236236
requires are_parameters_valid<Iterator, Args...>
237237
constexpr auto operator()(this Self&& self, Iterator first, Sentinel last, Args&&... args)
238-
-> decltype(std::forward<Self>(self).base_class::operator()(
238+
-> decltype(static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
239239
detail::choice_for_it<Iterator, sizeof...(Sorters)>{},
240240
std::move(first), std::move(last),
241241
std::forward<Args>(args)...
242242
))
243243
{
244-
return std::forward<Self>(self).base_class::operator()(
244+
return static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
245245
detail::choice_for_it<Iterator, sizeof...(Sorters)>{},
246246
std::move(first), std::move(last),
247247
std::forward<Args>(args)...

0 commit comments

Comments
 (0)