From 9f9d19930c3ec597bd1ebc2a9c2a84b9fd49674e Mon Sep 17 00:00:00 2001 From: YasunoriHirakawa Date: Wed, 3 Aug 2022 07:46:03 +0900 Subject: [PATCH] Remove Dynamic Exception Specification to make compilable with C++17 and newer --- src/Vocabulary.cpp | 6 +++--- src/Vocabulary.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Vocabulary.cpp b/src/Vocabulary.cpp index 9f0eff3..28f4697 100644 --- a/src/Vocabulary.cpp +++ b/src/Vocabulary.cpp @@ -1177,7 +1177,7 @@ void Vocabulary::save(cv::FileStorage &f, } -void Vocabulary::toStream( std::ostream &out_str, bool compressed) const throw(std::exception){ +void Vocabulary::toStream( std::ostream &out_str, bool compressed) const noexcept(false){ uint64_t sig=88877711233;//magic number describing the file out_str.write((char*)&sig,sizeof(sig)); @@ -1257,7 +1257,7 @@ void Vocabulary::toStream( std::ostream &out_str, bool compressed) const throw( } -void Vocabulary:: load_fromtxt(const std::string &filename)throw(std::runtime_error){ +void Vocabulary:: load_fromtxt(const std::string &filename)noexcept(false){ std::ifstream ifile(filename); if(!ifile)throw std::runtime_error("Vocabulary:: load_fromtxt Could not open file for reading:"+filename); @@ -1332,7 +1332,7 @@ void Vocabulary:: load_fromtxt(const std::string &filename)throw(std::runtime_er } } } -void Vocabulary::fromStream( std::istream &str ) throw(std::exception){ +void Vocabulary::fromStream( std::istream &str ) noexcept(false){ m_words.clear(); diff --git a/src/Vocabulary.h b/src/Vocabulary.h index 7cf5f5a..3578ab3 100644 --- a/src/Vocabulary.h +++ b/src/Vocabulary.h @@ -299,8 +299,8 @@ friend class FastSearch; */ int getDescritorType()const; //io to-from a stream - void toStream( std::ostream &str, bool compressed=true) const throw(std::exception); - void fromStream( std::istream &str ) throw(std::exception); + void toStream( std::ostream &str, bool compressed=true) const noexcept(false); + void fromStream( std::istream &str ) noexcept(false); protected: @@ -435,7 +435,7 @@ friend class FastSearch; /**Loads from ORBSLAM txt files */ - void load_fromtxt(const std::string &filename)throw(std::runtime_error); + void load_fromtxt(const std::string &filename)noexcept(false); protected: