[glibmm/glibmm-2-50] C++11: Variant: Replace more throw(std::bad_cast) with noexcept(false).



commit 140a8e67dbac6133ea940da8d902f39900664997
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 4 19:58:59 2017 +0200

    C++11: Variant: Replace more throw(std::bad_cast) with noexcept(false).
    
    This is necessary for C++17 which completely removes dynamic
    exception specifications.
    See https://bugzilla.redhat.com/show_bug.cgi?id=1438766

 glib/src/variant.ccg |    4 ++--
 glib/src/variant.hg  |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index a77e878..9c47dea 100644
--- a/glib/src/variant.ccg
+++ b/glib/src/variant.ccg
@@ -335,7 +335,7 @@ Variant<Glib::ustring>::get() const
 // See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
 template <>
 Variant<Glib::ustring>
-VariantBase::cast_dynamic<Variant<Glib::ustring>>(const VariantBase& v) throw(std::bad_cast)
+VariantBase::cast_dynamic<Variant<Glib::ustring>>(const VariantBase& v) noexcept(false)
 {
   if (!v.gobj())
   {
@@ -384,7 +384,7 @@ Variant<std::string>::create(const std::string& data)
 // See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
 template <>
 Variant<std::string>
-VariantBase::cast_dynamic<Variant<std::string>>(const VariantBase& v) throw(std::bad_cast)
+VariantBase::cast_dynamic<Variant<std::string>>(const VariantBase& v) noexcept(false)
 {
   if (!v.gobj())
   {
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index 2e6c5ce..de10195 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -271,7 +271,7 @@ private:
 
 template<class V_CastTo>
 V_CastTo VariantBase::cast_dynamic(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
 {
   if(!(v.gobj()))
   {
@@ -433,7 +433,7 @@ protected:
 
 template<>
 VariantContainerBase VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
 
 /** Template class used for the specialization of the Variant<> classes.
  * @newin{2,28}
@@ -594,7 +594,7 @@ public:
 //TODO: When we can break ABI, remove this template specialization.
 template<>
 Variant<Glib::ustring> VariantBase::cast_dynamic< Variant<Glib::ustring> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
 
 /** Specialization of Variant containing a std::string, for variants of type
  * bytestring, string, object path, or signature.
@@ -643,7 +643,7 @@ public:
 //TODO: When we can break ABI, remove this template specialization.
 template<>
 Variant<std::string> VariantBase::cast_dynamic< Variant<std::string> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
 
 /** Specialization of Variant containing a dictionary entry.  See also
  * Variant< std::map<K, V> >.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]