Skip to content

Commit

Permalink
Revert "const variant is not needed"
Browse files Browse the repository at this point in the history
This reverts commit 431b0f1.
  • Loading branch information
wusatosi committed Nov 21, 2024
1 parent 431b0f1 commit 12fe05e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/beman/inplace_vector/inplace_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct inplace_vector_type_based_storage {
inplace_vector_array_type<T, Capacity> elems{};

constexpr T *begin() { return elems.data(); }
constexpr const T *begin() const { return elems.data(); }
};

// byte array based storage is used for non-constexpr environment, where default
Expand All @@ -80,6 +81,9 @@ struct inplace_vector_bytes_based_storage {
alignas(T) inplace_vector_array_type<std::byte, Capacity * sizeof(T)> elems;

T *begin() { return std::launder(reinterpret_cast<const T *>(elems)); }
const T *begin() const {
return std::launder(reinterpret_cast<const T *>(elems));
}
};

// Base class for inplace_vector
Expand Down

0 comments on commit 12fe05e

Please sign in to comment.