summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2017-04-04 19:58:59 +0200
committerMurray Cumming <murrayc@murrayc.com>2017-04-04 19:59:42 +0200
commit140a8e67dbac6133ea940da8d902f39900664997 (patch)
treec69f183658e85d28c0348ee413d98c7d4d0df63b
parent6cf11562e66d1fb3ee3d1a81029912ef8f62dcbd (diff)
downloadglibmm-140a8e67dbac6133ea940da8d902f39900664997.tar.gz
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
-rw-r--r--glib/src/variant.ccg4
-rw-r--r--glib/src/variant.hg8
2 files changed, 6 insertions, 6 deletions
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index a77e8788..9c47dea2 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 2e6c5ce5..de101954 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> >.