We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c2d9f8 commit 4f69310Copy full SHA for 4f69310
include/boost/hana/view.hpp
@@ -583,7 +583,8 @@ BOOST_HANA_NAMESPACE_BEGIN
583
static constexpr auto apply(View view, N const&) {
584
constexpr auto n = N::value;
585
constexpr auto Length = decltype(hana::length(view))::value;
586
- return detail::sliced(view, hana::range_c<std::size_t, n, Length>);
+ constexpr auto begin = (n > Length ? Length : n);
587
+ return detail::sliced(view, hana::range_c<std::size_t, begin, Length>);
588
}
589
};
590
0 commit comments