Clarify what SourceLocation functions can throw
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 6 Aug 2018 10:39:49 +0000 (12:39 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 6 Aug 2018 10:39:49 +0000 (12:39 +0200)
src/source_track_basics.cpp
src/source_track_basics.hpp

index 25ad139..9f8f470 100644 (file)
@@ -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 )
index d109e69..ad18cb8 100644 (file)
@@ -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;