Skip to content

Commit

Permalink
Deleted some constructors in h5pp::Hyperslab to avoid ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed Nov 24, 2020
1 parent 628bd04 commit e948625
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions h5pp/include/h5pp/details/h5ppHyperslab.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ namespace h5pp {
Hyperslab(const DimsType &offset, const DimsType &extent, OptDimsType stride = std::nullopt, OptDimsType blocks = std::nullopt)
: offset(offset), extent(extent), stride(std::move(stride)), blocks(std::move(blocks)) {}

// Delete some constructors to avoid ambiguity. Both offset and extent are required if any of them is to be given
Hyperslab(DimsType) = delete;
Hyperslab(OptDimsType) = delete;
Hyperslab(std::initializer_list<hsize_t>) = delete;
Hyperslab(std::vector<hsize_t>) = delete;

explicit Hyperslab(const hid::h5s &space) {
int rank = H5Sget_simple_extent_ndims(space);
if(rank < 0) throw std::runtime_error("Could not read ndims on given space");
Expand Down

0 comments on commit e948625

Please sign in to comment.