summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataSpace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5DataSpace.cpp')
-rw-r--r--c++/src/H5DataSpace.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index c20a88c..342e9fa 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -88,9 +88,8 @@ const DataSpace &DataSpace::ALL = *getConstant();
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace::DataSpace(H5S_class_t type) : IdComponent()
+DataSpace::DataSpace(H5S_class_t type) : IdComponent(), id{H5Screate(type)}
{
- id = H5Screate(type);
if (id < 0) {
throw DataSpaceIException("DataSpace constructor", "H5Screate failed");
}
@@ -105,9 +104,9 @@ DataSpace::DataSpace(H5S_class_t type) : IdComponent()
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace::DataSpace(int rank, const hsize_t *dims, const hsize_t *maxdims) : IdComponent()
+DataSpace::DataSpace(int rank, const hsize_t *dims, const hsize_t *maxdims)
+ : IdComponent(), id{H5Screate_simple(rank, dims, maxdims)}
{
- id = H5Screate_simple(rank, dims, maxdims);
if (id < 0) {
throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed");
}