From: Christian Herdtweck Date: Mon, 6 Aug 2018 10:39:49 +0000 (+0200) Subject: Clarify what SourceLocation functions can throw X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=81d5dc95b9cdac5d891fcee4596d6ab4b95c497b;p=libi2ncommon Clarify what SourceLocation functions can throw --- diff --git a/src/source_track_basics.cpp b/src/source_track_basics.cpp index 25ad139..9f8f470 100644 --- a/src/source_track_basics.cpp +++ b/src/source_track_basics.cpp @@ -37,7 +37,7 @@ namespace I2n ** implementation of SourceLocation */ -SourceLocation::SourceLocation() +SourceLocation::SourceLocation() throw () : Line ( 0 ) { } // eo SourceLocation::SourceLocation() @@ -47,7 +47,7 @@ SourceLocation::SourceLocation ( const std::string& file, long line, const std::string& funcname -) +) throw () : File( file ) , Line( line ) , FunctionName( funcname ) diff --git a/src/source_track_basics.hpp b/src/source_track_basics.hpp index d109e69..ad18cb8 100644 --- a/src/source_track_basics.hpp +++ b/src/source_track_basics.hpp @@ -33,7 +33,7 @@ on this file might be covered by the GNU General Public License. */ /** - * macro which encapsulates the construction of a source location. + * macro which encapsulates the construction of a source location. Never throws */ #define HERE ::I2n::SourceLocation(__FILE__,__LINE__,BOOST_CURRENT_FUNCTION) @@ -52,21 +52,21 @@ struct SourceLocation long Line; std::string FunctionName; - SourceLocation(); + SourceLocation() throw (); SourceLocation( const std::string& file, long line, - const std::string& funcname); + const std::string& funcname) throw (); - operator bool() const + operator bool() const throw () { return Line>0 and not File.empty() and not FunctionName.empty(); } // eo operator bool - std::string get_function_name() const { return FunctionName; } - std::string get_filename() const { return File; } - long get_line_number() const { return Line; } + std::string get_function_name() const throw () { return FunctionName; } + std::string get_filename() const throw () { return File; } + long get_line_number() const throw () { return Line; } std::string get_location_tag() const;