Skip to content

Commit

Permalink
Fixing github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed Jan 21, 2025
1 parent 9fa74e7 commit 180ea86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/h5pp/details/h5ppDimensionType.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ namespace h5pp {
explicit OptDimsType(hid::h5t) = delete;
explicit OptDimsType(hid_t) = delete;

template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
template<typename T>
OptDimsType(std::initializer_list<T> &&list)
: std::optional<std::vector<hsize_t>>(std::vector<hsize_t>(std::begin(list), std::end(list))) {}
: std::optional<std::vector<hsize_t>>(std::vector<hsize_t>(std::begin(list), std::end(list))) {
static_assert(std::is_integral_v<T>);
}

template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
OptDimsType(T v) : std::optional<std::vector<hsize_t>>(std::vector<hsize_t>(1ul, type::safe_cast<hsize_t>(v))) {}
Expand All @@ -48,8 +50,10 @@ namespace h5pp {
OptDimsType(T &&dims_)
: std::optional<std::vector<hsize_t>>(std::vector<hsize_t>(std::begin(dims_), std::end(dims_))) {}

template<typename T, typename = std::enable_if_t<h5pp::type::sfinae::is_iterable_v<T>>>
template<typename T>
OptDimsType(std::optional<T> &&dims_)
: std::optional<std::vector<hsize_t>>(dims_.has_value() ? OptDimsType(dims_.value()) : std::nullopt) {}
: std::optional<std::vector<hsize_t>>(dims_.has_value() ? OptDimsType(dims_.value()) : std::nullopt) {
static_assert(h5pp::type::sfinae::is_iterable_v<T>);
}
};
}

0 comments on commit 180ea86

Please sign in to comment.