From 623907f39764b043ca6205a00663fa325bb17e97 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 9 Feb 2024 12:29:55 -0500 Subject: Modern C++ dtor declarations (#1830) * C++ dtor modernization - Replaced a bunch of empty dtors with `= default` - Removed deprecated `throw()`. In C++11, dtors are `noexcept` by default. * --- c++/src/H5AbstractDs.cpp | 8 ---- c++/src/H5AbstractDs.h | 2 +- c++/src/H5ArrayType.cpp | 8 ---- c++/src/H5ArrayType.h | 2 +- c++/src/H5AtomType.cpp | 10 ----- c++/src/H5AtomType.h | 2 +- c++/src/H5CommonFG.cpp | 8 ---- c++/src/H5CommonFG.h | 2 +- c++/src/H5CompType.cpp | 8 ---- c++/src/H5CompType.h | 2 +- c++/src/H5DaccProp.cpp | 8 ---- c++/src/H5DaccProp.h | 2 +- c++/src/H5DcreatProp.cpp | 8 ---- c++/src/H5DcreatProp.h | 2 +- c++/src/H5DxferProp.cpp | 8 ---- c++/src/H5DxferProp.h | 2 +- c++/src/H5EnumType.cpp | 8 ---- c++/src/H5EnumType.h | 2 +- c++/src/H5Exception.cpp | 93 ----------------------------------------------- c++/src/H5Exception.h | 26 ++++++------- c++/src/H5FaccProp.cpp | 8 ---- c++/src/H5FaccProp.h | 2 +- c++/src/H5FcreatProp.cpp | 8 ---- c++/src/H5FcreatProp.h | 2 +- c++/src/H5FloatType.cpp | 8 ---- c++/src/H5FloatType.h | 2 +- c++/src/H5IdComponent.cpp | 8 ---- c++/src/H5IdComponent.h | 2 +- c++/src/H5IntType.cpp | 8 ---- c++/src/H5IntType.h | 2 +- c++/src/H5LaccProp.cpp | 8 ---- c++/src/H5LaccProp.h | 2 +- c++/src/H5LcreatProp.cpp | 9 ----- c++/src/H5LcreatProp.h | 2 +- c++/src/H5Library.cpp | 8 ---- c++/src/H5Library.h | 2 +- c++/src/H5Location.cpp | 8 ---- c++/src/H5Location.h | 2 +- c++/src/H5Object.cpp | 10 ----- c++/src/H5Object.h | 2 +- c++/src/H5OcreatProp.cpp | 8 ---- c++/src/H5OcreatProp.h | 2 +- c++/src/H5PredType.cpp | 9 ----- c++/src/H5PredType.h | 2 +- c++/src/H5StrType.cpp | 8 ---- c++/src/H5StrType.h | 2 +- c++/src/H5VarLenType.cpp | 8 ---- c++/src/H5VarLenType.h | 2 +- c++/test/h5cpputil.cpp | 14 ------- c++/test/h5cpputil.h | 4 +- 50 files changed, 38 insertions(+), 335 deletions(-) diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 7ea107c..ab3faba 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -316,12 +316,4 @@ AbstractDs::getVarLenType() const } } -//-------------------------------------------------------------------------- -// Function: AbstractDs destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -AbstractDs::~AbstractDs() -{ -} - } // namespace H5 diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 49bcfeb..d831bd6 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -67,7 +67,7 @@ class H5_DLLCPP AbstractDs { virtual H5std_string fromClass() const = 0; // Destructor - virtual ~AbstractDs(); + virtual ~AbstractDs() = default; protected: // Default constructor diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index c5ad7ea..3a2da2b 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -199,12 +199,4 @@ ArrayType::getArrayDims(hsize_t *dims) const return (ndims); } -//-------------------------------------------------------------------------- -// Function: ArrayType destructor -///\brief Properly terminates access to this array datatype. -//-------------------------------------------------------------------------- -ArrayType::~ArrayType() -{ -} - } // namespace H5 diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index e9afb9c..e02a3a2 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -60,7 +60,7 @@ class H5_DLLCPP ArrayType : public DataType { ArrayType(const hid_t existing_id); // Noop destructor - virtual ~ArrayType() override; + virtual ~ArrayType() override = default; // Default constructor ArrayType(); diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index db6c8f8..f2e037a 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -276,14 +276,4 @@ AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const } } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -//-------------------------------------------------------------------------- -// Function: AtomType destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -AtomType::~AtomType() -{ -} -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace H5 diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index bb2cf48..327604d 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -67,7 +67,7 @@ class H5_DLLCPP AtomType : public DataType { AtomType(const AtomType &original); // Noop destructor - virtual ~AtomType() override; + virtual ~AtomType() override = default; #endif // DOXYGEN_SHOULD_SKIP_THIS protected: diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 277ba34..d26c83f 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -343,14 +343,6 @@ CommonFG::CommonFG() } //-------------------------------------------------------------------------- -// Function: CommonFG destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -CommonFG::~CommonFG() -{ -} - -//-------------------------------------------------------------------------- // Function: f_DataType_setId - friend // Purpose: This function is friend to class H5::DataType so that it // can set DataType::id in order to work around a problem diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index e675617..6eb01db 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -72,7 +72,7 @@ class H5_DLLCPP CommonFG { CommonFG(); // Noop destructor. - virtual ~CommonFG(); + virtual ~CommonFG() = default; protected: virtual void p_setId(const hid_t new_id) = 0; diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index c89fa5c..70bbe66 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -527,12 +527,4 @@ CompType::setSize(size_t size) const } } -//-------------------------------------------------------------------------- -// Function: CompType destructor -///\brief Properly terminates access to this compound datatype. -//-------------------------------------------------------------------------- -CompType::~CompType() -{ -} - } // namespace H5 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 0675d20..a642b0d 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -113,7 +113,7 @@ class H5_DLLCPP CompType : public DataType { } // Noop destructor. - virtual ~CompType() override; + virtual ~CompType() override = default; private: // Contains common code that is used by the member functions diff --git a/c++/src/H5DaccProp.cpp b/c++/src/H5DaccProp.cpp index 8b01665..ba4c8ef 100644 --- a/c++/src/H5DaccProp.cpp +++ b/c++/src/H5DaccProp.cpp @@ -153,12 +153,4 @@ DSetAccPropList::getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double } } -//-------------------------------------------------------------------------- -// Function: DSetAccPropList destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DSetAccPropList::~DSetAccPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5DaccProp.h b/c++/src/H5DaccProp.h index bb404ce..3f101f3 100644 --- a/c++/src/H5DaccProp.h +++ b/c++/src/H5DaccProp.h @@ -50,7 +50,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList { DSetAccPropList(const hid_t plist_id); // Noop destructor. - virtual ~DSetAccPropList() override; + virtual ~DSetAccPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 8b199a8..8f4ee7e 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -754,12 +754,4 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fn setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace); } -//-------------------------------------------------------------------------- -// Function: DSetCreatPropList destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DSetCreatPropList::~DSetCreatPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 94ecbb5..3c8587d 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -140,7 +140,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { DSetCreatPropList(const hid_t plist_id); // Noop destructor. - virtual ~DSetCreatPropList() override; + virtual ~DSetCreatPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 33e2ff5..1b9d651 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -527,12 +527,4 @@ DSetMemXferPropList::getEDCCheck() const return (check); } -//-------------------------------------------------------------------------- -// Function: DSetMemXferPropList destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DSetMemXferPropList::~DSetMemXferPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index d0a65c1..b86202d 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -112,7 +112,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { DSetMemXferPropList(const hid_t plist_id); // Noop destructor - virtual ~DSetMemXferPropList() override; + virtual ~DSetMemXferPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 03c07d9..569e56a 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -317,12 +317,4 @@ EnumType::getMemberValue(unsigned memb_no, void *value) const } } -//-------------------------------------------------------------------------- -// Function: EnumType destructor -///\brief Properly terminates access to this enum datatype. -//-------------------------------------------------------------------------- -EnumType::~EnumType() -{ -} - } // namespace H5 diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index a98688e..a5096fc 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -81,7 +81,7 @@ class H5_DLLCPP EnumType : public DataType { // Copy constructor: same as the original EnumType. EnumType(const EnumType &original); - virtual ~EnumType() override; + virtual ~EnumType() override = default; }; // end of EnumType } // namespace H5 diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 01b9cc1..906bd27 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -331,14 +331,6 @@ Exception::printErrorStack(FILE *stream, hid_t err_stack) //} //-------------------------------------------------------------------------- -// Function: Exception destructor -///\brief Noop destructor -//-------------------------------------------------------------------------- -Exception::~Exception() throw() -{ -} - -//-------------------------------------------------------------------------- // Subclass: FileIException //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -359,13 +351,6 @@ FileIException::FileIException(const H5std_string &func, const H5std_string &mes : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: FileIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -FileIException::~FileIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: GroupIException @@ -389,14 +374,6 @@ GroupIException::GroupIException(const H5std_string &func, const H5std_string &m { } //-------------------------------------------------------------------------- -// Function: GroupIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -GroupIException::~GroupIException() throw() -{ -} - -//-------------------------------------------------------------------------- // Subclass: DataSpaceIException //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -417,13 +394,6 @@ DataSpaceIException::DataSpaceIException(const H5std_string &func, const H5std_s : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: DataSpaceIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DataSpaceIException::~DataSpaceIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: DataTypeIException @@ -446,13 +416,6 @@ DataTypeIException::DataTypeIException(const H5std_string &func, const H5std_str : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: DataTypeIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DataTypeIException::~DataTypeIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: ObjHeaderIException @@ -475,13 +438,6 @@ ObjHeaderIException::ObjHeaderIException(const H5std_string &func, const H5std_s : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: ObjHeaderIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -ObjHeaderIException::~ObjHeaderIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: PropListIException @@ -504,13 +460,6 @@ PropListIException::PropListIException(const H5std_string &func, const H5std_str : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: PropListIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -PropListIException::~PropListIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: DataSetIException @@ -533,13 +482,6 @@ DataSetIException::DataSetIException(const H5std_string &func, const H5std_strin : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: DataSetIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -DataSetIException::~DataSetIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: AttributeIException @@ -562,13 +504,6 @@ AttributeIException::AttributeIException(const H5std_string &func, const H5std_s : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: AttributeIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -AttributeIException::~AttributeIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: ReferenceException @@ -591,13 +526,6 @@ ReferenceException::ReferenceException(const H5std_string &func, const H5std_str : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: ReferenceException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -ReferenceException::~ReferenceException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: LibraryIException @@ -620,13 +548,6 @@ LibraryIException::LibraryIException(const H5std_string &func, const H5std_strin : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: LibraryIException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -LibraryIException::~LibraryIException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: LocationException @@ -649,13 +570,6 @@ LocationException::LocationException(const H5std_string &func, const H5std_strin : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: LocationException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -LocationException::~LocationException() throw() -{ -} //-------------------------------------------------------------------------- // Subclass: IdComponentException @@ -678,12 +592,5 @@ IdComponentException::IdComponentException(const H5std_string &func, const H5std : Exception(func, message) { } -//-------------------------------------------------------------------------- -// Function: IdComponentException destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -IdComponentException::~IdComponentException() throw() -{ -} } // namespace H5 diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index d4533e5..6bf51ef 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -74,7 +74,7 @@ class H5_DLLCPP Exception { Exception(const Exception &orig); // virtual Destructor - virtual ~Exception() throw(); + virtual ~Exception() = default; protected: // Default value for detail_message @@ -89,84 +89,84 @@ class H5_DLLCPP FileIException : public Exception { public: FileIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); FileIException(); - virtual ~FileIException() throw() override; + virtual ~FileIException() override = default; }; class H5_DLLCPP GroupIException : public Exception { public: GroupIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); GroupIException(); - virtual ~GroupIException() throw() override; + virtual ~GroupIException() override = default; }; class H5_DLLCPP DataSpaceIException : public Exception { public: DataSpaceIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSpaceIException(); - virtual ~DataSpaceIException() throw() override; + virtual ~DataSpaceIException() override = default; }; class H5_DLLCPP DataTypeIException : public Exception { public: DataTypeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataTypeIException(); - virtual ~DataTypeIException() throw() override; + virtual ~DataTypeIException() override = default; }; class H5_DLLCPP ObjHeaderIException : public Exception { public: ObjHeaderIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ObjHeaderIException(); - virtual ~ObjHeaderIException() throw() override; + virtual ~ObjHeaderIException() override = default; }; class H5_DLLCPP PropListIException : public Exception { public: PropListIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); PropListIException(); - virtual ~PropListIException() throw() override; + virtual ~PropListIException() override = default; }; class H5_DLLCPP DataSetIException : public Exception { public: DataSetIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSetIException(); - virtual ~DataSetIException() throw() override; + virtual ~DataSetIException() override = default; }; class H5_DLLCPP AttributeIException : public Exception { public: AttributeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); AttributeIException(); - virtual ~AttributeIException() throw() override; + virtual ~AttributeIException() override = default; }; class H5_DLLCPP ReferenceException : public Exception { public: ReferenceException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ReferenceException(); - virtual ~ReferenceException() throw() override; + virtual ~ReferenceException() override = default; }; class H5_DLLCPP LibraryIException : public Exception { public: LibraryIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LibraryIException(); - virtual ~LibraryIException() throw() override; + virtual ~LibraryIException() override = default; }; class H5_DLLCPP LocationException : public Exception { public: LocationException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LocationException(); - virtual ~LocationException() throw() override; + virtual ~LocationException() override = default; }; class H5_DLLCPP IdComponentException : public Exception { public: IdComponentException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); IdComponentException(); - virtual ~IdComponentException() throw() override; + virtual ~IdComponentException() override = default; }; // end of IdComponentException } // namespace H5 diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index ea5692a..dc4b949 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -769,12 +769,4 @@ FileAccPropList::getLibverBounds(H5F_libver_t &libver_low, H5F_libver_t &libver_ } } -//-------------------------------------------------------------------------- -// Function: FileAccPropList destructor -///\brief Noop destructor -//-------------------------------------------------------------------------- -FileAccPropList::~FileAccPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 27028a2..67394f1 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -149,7 +149,7 @@ class H5_DLLCPP FileAccPropList : public PropList { FileAccPropList(const hid_t plist_id); // Noop destructor - virtual ~FileAccPropList() override; + virtual ~FileAccPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index fe46dee..66e4ceb 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -357,12 +357,4 @@ FileCreatPropList::getFileSpacePagesize() const return (fsp_psize); } -//-------------------------------------------------------------------------- -// Function: FileCreatPropList destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -FileCreatPropList::~FileCreatPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 399db71..76c2ae5 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -90,7 +90,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { FileCreatPropList(const hid_t plist_id); // Noop destructor - virtual ~FileCreatPropList() override; + virtual ~FileCreatPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 74170da..41ee8a8 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -326,12 +326,4 @@ FloatType::setInpad(H5T_pad_t inpad) const } } -//-------------------------------------------------------------------------- -// Function: FloatType destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -FloatType::~FloatType() -{ -} - } // namespace H5 diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 42437ec..b804892 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -78,7 +78,7 @@ class H5_DLLCPP FloatType : public AtomType { FloatType(const FloatType &original); // Noop destructor. - virtual ~FloatType() override; + virtual ~FloatType() override = default; }; // end of FloatType } // namespace H5 diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 93df343..0d15aac 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -307,14 +307,6 @@ IdComponent::setId(const hid_t new_id) incRefCount(); } -//-------------------------------------------------------------------------- -// Function: IdComponent destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -IdComponent::~IdComponent() -{ -} - // // Implementation of protected functions for HDF5 Reference Interface // and miscellaneous helpers. diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index d64bdb5..2fef96f 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -81,7 +81,7 @@ class H5_DLLCPP IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS // Destructor - virtual ~IdComponent(); + virtual ~IdComponent() = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 87a287f..7c8b7d3 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -182,12 +182,4 @@ IntType::setSign(H5T_sign_t sign) const } } -//-------------------------------------------------------------------------- -// Function: IntType destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -IntType::~IntType() -{ -} - } // namespace H5 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 170ed37..1ca0ab1 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -60,7 +60,7 @@ class H5_DLLCPP IntType : public AtomType { IntType(const IntType &original); // Noop destructor. - virtual ~IntType() override; + virtual ~IntType() override = default; }; // end of IntType } // namespace H5 diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index 0285ee7..7a66c13 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -140,12 +140,4 @@ LinkAccPropList::getNumLinks() const return (nlinks); } -//-------------------------------------------------------------------------- -// Function: LinkAccPropList destructor -///\brief Noop destructor -//-------------------------------------------------------------------------- -LinkAccPropList::~LinkAccPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 53389e2..6f4b919 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -51,7 +51,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { size_t getNumLinks() const; // Noop destructor - virtual ~LinkAccPropList() override; + virtual ~LinkAccPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp index 2f34375..0dbb0b2 100644 --- a/c++/src/H5LcreatProp.cpp +++ b/c++/src/H5LcreatProp.cpp @@ -184,13 +184,4 @@ LinkCreatPropList::getCharEncoding() const return (encoding); } -//-------------------------------------------------------------------------- -// Function: LinkCreatPropList destructor -///\brief Noop destructor -// December, 2016 -//-------------------------------------------------------------------------- -LinkCreatPropList::~LinkCreatPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h index 233a98b..272f260 100644 --- a/c++/src/H5LcreatProp.h +++ b/c++/src/H5LcreatProp.h @@ -58,7 +58,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList { H5T_cset_t getCharEncoding() const; // Noop destructor - virtual ~LinkCreatPropList() override; + virtual ~LinkCreatPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 019ae67..c16bd81 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -273,14 +273,6 @@ H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, int arr_globa H5Library::H5Library() { } - -//-------------------------------------------------------------------------- -// Function: H5Library destructor -///\brief Noop destructor -//-------------------------------------------------------------------------- -H5Library::~H5Library() -{ -} #endif // DOXYGEN_SHOULD_SKIP_THIS } // namespace H5 diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 3770639..10e5536 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -62,7 +62,7 @@ class H5_DLLCPP H5Library { H5Library(); // Destructor - ~H5Library(); + ~H5Library() = default; #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of H5Library diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 8befefc..87eac67 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -2367,12 +2367,4 @@ f_DataSpace_setId(DataSpace *dspace, hid_t new_id) dspace->p_setId(new_id); } -//-------------------------------------------------------------------------- -// Function: H5Location destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -H5Location::~H5Location() -{ -} - } // namespace H5 diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index ee45d67..f10a005 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -333,7 +333,7 @@ class H5_DLLCPP H5Location : public IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS // Noop destructor. - virtual ~H5Location() override; + virtual ~H5Location() override = default; }; // end of H5Location } // namespace H5 diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 2b898e7..5411437 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -541,14 +541,4 @@ H5Object::getObjName(H5std_string &obj_name, size_t len) const return name_size; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -//-------------------------------------------------------------------------- -// Function: H5Object destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -H5Object::~H5Object() -{ -} -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace H5 diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 1e93c0c..b290584 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -124,7 +124,7 @@ class H5_DLLCPP H5Object : public H5Location { virtual void p_setId(const hid_t new_id) override = 0; // Noop destructor. - virtual ~H5Object() override; + virtual ~H5Object() override = default; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 54808cb..0f1da1c 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -199,12 +199,4 @@ ObjCreatPropList::getAttrCrtOrder() const return (crt_order_flags); } -//-------------------------------------------------------------------------- -// Function: ObjCreatPropList destructor -///\brief Noop destructor -//-------------------------------------------------------------------------- -ObjCreatPropList::~ObjCreatPropList() -{ -} - } // namespace H5 diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 6d752ed..fbe3991 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -56,7 +56,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { ObjCreatPropList(const hid_t plist_id); // Noop destructor - virtual ~ObjCreatPropList() override; + virtual ~ObjCreatPropList() override = default; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 6aa5b17..0338a01 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -108,15 +108,6 @@ PredType::committed() } #endif // DOXYGEN_SHOULD_SKIP_THIS -// Default destructor -//-------------------------------------------------------------------------- -// Function: PredType destructor -///\brief Noop destructor. -//-------------------------------------------------------------------------- -PredType::~PredType() -{ -} - /***************************************************************************** The following section is regarding the global constants PredType, DataSpace, and PropList. diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 1e305fc..85b6e96 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -41,7 +41,7 @@ class H5_DLLCPP PredType : public AtomType { PredType(const PredType &original); // Noop destructor - virtual ~PredType() override; + virtual ~PredType() override = default; /*! \brief This dummy function do not inherit from DataType - it will throw a DataTypeIException if invoked. diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 2c47809..1b45814 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -290,12 +290,4 @@ StrType::setStrpad(H5T_str_t strpad) const } } -//-------------------------------------------------------------------------- -// Function: StrType destructor -///\brief Properly terminates access to this string datatype. -//-------------------------------------------------------------------------- -StrType::~StrType() -{ -} - } // namespace H5 diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index ccae3e7..0f51e75 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -72,7 +72,7 @@ class H5_DLLCPP StrType : public AtomType { StrType(const StrType &original); // Noop destructor. - virtual ~StrType() override; + virtual ~StrType() override = default; }; // end of StrType } // namespace H5 diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index e8b7cbb..49f2cbd 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -146,12 +146,4 @@ VarLenType::decode() const return (encoded_vltype); } -//-------------------------------------------------------------------------- -// Function: VarLenType destructor -///\brief Properly terminates access to this datatype. -//-------------------------------------------------------------------------- -VarLenType::~VarLenType() -{ -} - } // namespace H5 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 318681a..d7f0ff1 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -52,7 +52,7 @@ class H5_DLLCPP VarLenType : public DataType { VarLenType(const H5Location &loc, const H5std_string &name); // Noop destructor - virtual ~VarLenType() override; + virtual ~VarLenType() override = default; // Default constructor VarLenType(); diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index c3feefa..933aa7d 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -198,13 +198,6 @@ InvalidActionException::InvalidActionException(const H5std_string &func, const H } //-------------------------------------------------------------------------- -// Function: InvalidActionException destructor -//-------------------------------------------------------------------------- -InvalidActionException::~InvalidActionException() throw() -{ -} - -//-------------------------------------------------------------------------- // Function: TestFailedException default constructor //-------------------------------------------------------------------------- TestFailedException::TestFailedException() : Exception() @@ -225,10 +218,3 @@ TestFailedException::TestFailedException(const H5std_string &func, const H5std_s : Exception(func, message) { } - -//-------------------------------------------------------------------------- -// Function: TestFailedException destructor -//-------------------------------------------------------------------------- -TestFailedException::~TestFailedException() throw() -{ -} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 392382d..fa6822a 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -49,14 +49,14 @@ class InvalidActionException : public Exception { public: InvalidActionException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); InvalidActionException(); - ~InvalidActionException() throw() override; + ~InvalidActionException() override = default; }; class TestFailedException : public Exception { public: TestFailedException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); TestFailedException(); - ~TestFailedException() throw() override; + ~TestFailedException() override = default; }; // Overloaded/Template functions to verify values and display proper info -- cgit v0.12