Skip to content

Commit

Permalink
Check that sizeof(std::array<T, N>) == N * sizeof(T). (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc authored Oct 24, 2023
1 parent fb3be10 commit 21b7b59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/highfive/bits/H5Inspector_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ struct inspector<std::array<T, N>> {
static constexpr size_t ndim = 1;
static constexpr size_t recursive_ndim = ndim + inspector<value_type>::recursive_ndim;
static constexpr bool is_trivially_copyable = std::is_trivially_copyable<value_type>::value &&
sizeof(type) == N * sizeof(T) &&
inspector<value_type>::is_trivially_copyable;

static std::vector<size_t> getDimensions(const type& val) {
Expand Down

0 comments on commit 21b7b59

Please sign in to comment.