Skip to content

Commit 12fe05e

Browse files
committed
Revert "const variant is not needed"
This reverts commit 431b0f1.
1 parent 431b0f1 commit 12fe05e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/beman/inplace_vector/inplace_vector.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct inplace_vector_type_based_storage {
6969
inplace_vector_array_type<T, Capacity> elems{};
7070

7171
constexpr T *begin() { return elems.data(); }
72+
constexpr const T *begin() const { return elems.data(); }
7273
};
7374

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

8283
T *begin() { return std::launder(reinterpret_cast<const T *>(elems)); }
84+
const T *begin() const {
85+
return std::launder(reinterpret_cast<const T *>(elems));
86+
}
8387
};
8488

8589
// Base class for inplace_vector

0 commit comments

Comments
 (0)