Skip to content

Commit a1fd486

Browse files
committed
hybrid_adapter: fix infinite recursion error with Clang
1 parent caed9cc commit a1fd486

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>
@@ -213,13 +213,13 @@ namespace cppsort
213213

214214
template<typename Self, mstd::forward_range Range, typename... Args>
215215
constexpr auto operator()(this Self&& self, Range&& range, Args&&... args)
216-
-> decltype(std::forward<Self>(self).base_class::operator()(
216+
-> decltype(static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
217217
detail::choice_for_it<mstd::iterator_t<Range>, sizeof...(Sorters)>{},
218218
std::forward<Range>(range),
219219
std::forward<Args>(args)...
220220
))
221221
{
222-
return std::forward<Self>(self).base_class::operator()(
222+
return static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
223223
detail::choice_for_it<mstd::iterator_t<Range>, sizeof...(Sorters)>{},
224224
std::forward<Range>(range),
225225
std::forward<Args>(args)...
@@ -233,13 +233,13 @@ namespace cppsort
233233
typename... Args
234234
>
235235
constexpr auto operator()(this Self&& self, Iterator first, Sentinel last, Args&&... args)
236-
-> decltype(std::forward<Self>(self).base_class::operator()(
236+
-> decltype(static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
237237
detail::choice_for_it<Iterator, sizeof...(Sorters)>{},
238238
std::move(first), std::move(last),
239239
std::forward<Args>(args)...
240240
))
241241
{
242-
return std::forward<Self>(self).base_class::operator()(
242+
return static_cast<detail::copy_cvref_t<Self, base_class>>(self)(
243243
detail::choice_for_it<Iterator, sizeof...(Sorters)>{},
244244
std::move(first), std::move(last),
245245
std::forward<Args>(args)...

0 commit comments

Comments
 (0)