Skip to content

Commit

Permalink
Apply noreturn to impossible conversions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed Feb 11, 2019
1 parent 7dd0d5f commit a90f312
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/pqxx/strconv.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ template<> struct PQXX_LIBEXPORT string_traits<std::string>
static constexpr const char *name() noexcept { return "string"; }
static constexpr bool has_null() noexcept { return false; }
static bool is_null(const std::string &) { return false; }
static std::string null() { internal::throw_null_conversion(name()); }
[[noreturn]] static std::string null()
{ internal::throw_null_conversion(name()); }
static void from_string(const char Str[], std::string &Obj) { Obj=Str; }
static std::string to_string(const std::string &Obj) { return Obj; }
};
Expand All @@ -200,7 +201,8 @@ template<> struct PQXX_LIBEXPORT string_traits<const std::string>
static constexpr const char *name() noexcept { return "const string"; }
static constexpr bool has_null() noexcept { return false; }
static bool is_null(const std::string &) { return false; }
static const std::string null() { internal::throw_null_conversion(name()); }
[[noreturn]] static const std::string null()
{ internal::throw_null_conversion(name()); }
static const std::string to_string(const std::string &Obj) { return Obj; }
};

Expand All @@ -209,7 +211,8 @@ template<> struct PQXX_LIBEXPORT string_traits<std::stringstream>
static constexpr const char *name() noexcept { return "stringstream"; }
static constexpr bool has_null() noexcept { return false; }
static bool is_null(const std::stringstream &) { return false; }
static std::stringstream null() { internal::throw_null_conversion(name()); }
[[noreturn]] static std::stringstream null()
{ internal::throw_null_conversion(name()); }
static void from_string(const char Str[], std::stringstream &Obj)
{ Obj.clear(); Obj << Str; }
static std::string to_string(const std::stringstream &Obj)
Expand Down

0 comments on commit a90f312

Please sign in to comment.