fix(range): fix range adapter closure behavior

This commit is contained in:
2024-12-17 16:58:23 +08:00
parent aa8cd7ed33
commit 0a37460f24
5 changed files with 66 additions and 29 deletions

View File

@ -152,10 +152,12 @@ NODISCARD FORCEINLINE constexpr auto All(R&& InRange)
/** Creates A view adapter that includes all elements of a range. */
NODISCARD FORCEINLINE constexpr auto All()
{
return TAdaptorClosure([]<CViewableRange R> requires (requires { Range::All(DeclVal<R>()); }) (R&& Base)
using FClosure = decltype([]<CViewableRange R> requires (requires { Range::All(DeclVal<R>()); }) (R&& Base)
{
return Range::All(Forward<R>(Base));
});
return TAdaptorClosure<FClosure>();
}
/** A view adapter that includes all elements of a range. */