Skip to content

Commit

Permalink
Add static assertion to check saneness of types in maybe_static_array
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Mar 16, 2023
1 parent 49e1162 commit f3ad21e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/experimental/__p0009_bits/extents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ template <class T> struct possibly_empty_array<T, 0> {
// The position of a dynamic value is indicated through a tag value.
template <class TDynamic, class TStatic, TStatic dyn_tag, TStatic... Values>
struct maybe_static_array {

static_assert(is_convertible_v<TStatic, TDynamic>);
static_assert(is_convertible_v<TDynamic, TStatic>);

private:
// Static values member
using static_vals_t = static_array<TStatic, Values...>;
Expand Down

0 comments on commit f3ad21e

Please sign in to comment.