Skip to content

Commit

Permalink
use std::byte
Browse files Browse the repository at this point in the history
  • Loading branch information
wusatosi committed Nov 21, 2024
1 parent 8799d0b commit cfbc617
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/beman/inplace_vector/inplace_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <exception>
#include <iterator>
#include <limits>
Expand Down Expand Up @@ -75,7 +76,7 @@ struct inplace_vector_array_based_storage {
// Selecting this storage type implies: !std::is_trivial_v<T> and Capacity != 0
template <typename T, std::size_t Capacity>
struct inplace_vector_bytes_based_storage {
alignas(T) unsigned char elems[Capacity * sizeof(T)];
alignas(T) std::byte elems[Capacity * sizeof(T)];

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

0 comments on commit cfbc617

Please sign in to comment.