From d085e86cf852195823352830c24d7a70932f1270 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 8 Oct 2021 03:19:29 +0300 Subject: [PATCH] Add noexcept to destructors to support /Zc:implicitNoexcept-. Fixes #557. --- include/boost/json/array.hpp | 2 +- include/boost/json/impl/array.ipp | 2 +- include/boost/json/impl/object.ipp | 2 +- include/boost/json/impl/value.ipp | 2 +- include/boost/json/object.hpp | 2 +- include/boost/json/storage_ptr.hpp | 2 +- include/boost/json/string.hpp | 2 +- include/boost/json/value.hpp | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/boost/json/array.hpp b/include/boost/json/array.hpp index 6b66018d6..535ab4957 100644 --- a/include/boost/json/array.hpp +++ b/include/boost/json/array.hpp @@ -177,7 +177,7 @@ class array No-throw guarantee. */ BOOST_JSON_DECL - ~array(); + ~array() noexcept; //------------------------------------------------------ diff --git a/include/boost/json/impl/array.ipp b/include/boost/json/impl/array.ipp index 468cd04cd..4d067fb57 100644 --- a/include/boost/json/impl/array.ipp +++ b/include/boost/json/impl/array.ipp @@ -190,7 +190,7 @@ array(detail::unchecked_array&& ua) } array:: -~array() +~array() noexcept { destroy(); } diff --git a/include/boost/json/impl/object.ipp b/include/boost/json/impl/object.ipp index 07134265e..a7bdbcecb 100644 --- a/include/boost/json/impl/object.ipp +++ b/include/boost/json/impl/object.ipp @@ -239,7 +239,7 @@ object(detail::unchecked_object&& uo) } object:: -~object() +~object() noexcept { if(sp_.is_not_shared_and_deallocate_is_trivial()) return; diff --git a/include/boost/json/impl/value.ipp b/include/boost/json/impl/value.ipp index 4c6e16a74..d8f21e249 100644 --- a/include/boost/json/impl/value.ipp +++ b/include/boost/json/impl/value.ipp @@ -20,7 +20,7 @@ BOOST_JSON_NS_BEGIN value:: -~value() +~value() noexcept { switch(kind()) { diff --git a/include/boost/json/object.hpp b/include/boost/json/object.hpp index a287ab0fa..fbfc19848 100644 --- a/include/boost/json/object.hpp +++ b/include/boost/json/object.hpp @@ -164,7 +164,7 @@ class object No-throw guarantee. */ BOOST_JSON_DECL - ~object(); + ~object() noexcept; //------------------------------------------------------ diff --git a/include/boost/json/storage_ptr.hpp b/include/boost/json/storage_ptr.hpp index fc1c2dd6f..9f9fed897 100644 --- a/include/boost/json/storage_ptr.hpp +++ b/include/boost/json/storage_ptr.hpp @@ -146,7 +146,7 @@ class storage_ptr @par Exception Safety No-throw guarantee. */ - ~storage_ptr() + ~storage_ptr() noexcept { release(); } diff --git a/include/boost/json/string.hpp b/include/boost/json/string.hpp index 1b5ebed31..310d2fdd7 100644 --- a/include/boost/json/string.hpp +++ b/include/boost/json/string.hpp @@ -153,7 +153,7 @@ class string @par Exception Safety No-throw guarantee. */ - ~string() + ~string() noexcept { impl_.destroy(sp_); } diff --git a/include/boost/json/value.hpp b/include/boost/json/value.hpp index 1b728c699..e30488c0f 100644 --- a/include/boost/json/value.hpp +++ b/include/boost/json/value.hpp @@ -134,7 +134,7 @@ class value No-throw guarantee. */ BOOST_JSON_DECL - ~value(); + ~value() noexcept; /** Default constructor. @@ -3426,7 +3426,7 @@ class key_value_pair The value is destroyed and all internally allocated memory is freed. */ - ~key_value_pair() + ~key_value_pair() noexcept { auto const& sp = value_.storage(); if(sp.is_not_shared_and_deallocate_is_trivial())