Skip to content

Commit

Permalink
fix: replace std::for_each_n
Browse files Browse the repository at this point in the history
  • Loading branch information
tearfur committed Mar 16, 2024
1 parent 451cadb commit a59842f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/small/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,7 @@ namespace small {
// be running the destructor on exact byte copies of in-use
// elements, and you might free their internal buffers (oh no!).
if constexpr (!std::is_trivially_destructible_v<value_type>) {
std::for_each_n(
crbegin(),
n_erase,
[](value_type const &ele) { ele.~value_type(); });
std::destroy_n(crbegin(), n_erase);
}
}

Expand Down

0 comments on commit a59842f

Please sign in to comment.