Skip to content

Commit 4f69310

Browse files
committed
[view] Fix bug in drop_front
1 parent 7c2d9f8 commit 4f69310

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: include/boost/hana/view.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,8 @@ BOOST_HANA_NAMESPACE_BEGIN
583583
static constexpr auto apply(View view, N const&) {
584584
constexpr auto n = N::value;
585585
constexpr auto Length = decltype(hana::length(view))::value;
586-
return detail::sliced(view, hana::range_c<std::size_t, n, Length>);
586+
constexpr auto begin = (n > Length ? Length : n);
587+
return detail::sliced(view, hana::range_c<std::size_t, begin, Length>);
587588
}
588589
};
589590

0 commit comments

Comments
 (0)