Skip to content

Commit be19f52

Browse files
committed
refactor: use BOOST_NOEXCEPT_OR_NOTHROW
specifier `throw()` is deprecated since C++11
1 parent f604eb8 commit be19f52

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

include/boost/python/instance_holder.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# include <boost/python/detail/prefix.hpp>
99

10+
# include <boost/config.hpp>
1011
# include <boost/noncopyable.hpp>
1112
# include <boost/python/type_id.hpp>
1213
# include <cstddef>
@@ -31,7 +32,7 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable
3132
// that always holds the Python object.
3233
virtual void* holds(type_info, bool null_ptr_only) = 0;
3334

34-
void install(PyObject* inst) throw();
35+
void install(PyObject* inst) BOOST_NOEXCEPT_OR_NOTHROW;
3536

3637
// These functions should probably be located elsewhere.
3738

@@ -42,7 +43,7 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable
4243

4344
// Deallocate storage from the heap if it was not carved out of
4445
// the given Python object by allocate(), above.
45-
static void deallocate(PyObject*, void* storage) throw();
46+
static void deallocate(PyObject*, void* storage) BOOST_NOEXCEPT_OR_NOTHROW;
4647
private:
4748
instance_holder* m_next;
4849
};

src/object/class.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <boost/python/detail/prefix.hpp>
7+
#include <boost/config.hpp>
78
#include <boost/mpl/lambda.hpp> // #including this first is an intel6 workaround
89
#include <boost/cstdint.hpp>
910

@@ -302,7 +303,7 @@ static PyTypeObject class_metatype_object = {
302303

303304
// Install the instance data for a C++ object into a Python instance
304305
// object.
305-
void instance_holder::install(PyObject* self) throw()
306+
void instance_holder::install(PyObject* self) BOOST_NOEXCEPT_OR_NOTHROW
306307
{
307308
assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self)), &class_metatype_object));
308309
m_next = ((objects::instance<>*)self)->objects;
@@ -779,7 +780,7 @@ void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset, std:
779780
}
780781
}
781782

782-
void instance_holder::deallocate(PyObject* self_, void* storage) throw()
783+
void instance_holder::deallocate(PyObject* self_, void* storage) BOOST_NOEXCEPT_OR_NOTHROW
783784
{
784785
assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self_)), &class_metatype_object));
785786
objects::instance<>* self = (objects::instance<>*)self_;

test/module_tail.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ extern "C" void (*old_translator)(unsigned, EXCEPTION_POINTERS*)
3131
#include <exception>
3232
#include <boost/python/extract.hpp>
3333
#include <boost/python/str.hpp>
34+
#include <boost/config.hpp>
35+
3436
struct test_failure : std::exception
3537
{
3638
test_failure(char const* expr, char const* /*function*/, char const* file, unsigned line)
3739
: msg(file + boost::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr)
3840
{}
3941

40-
~test_failure() throw() {}
42+
~test_failure() BOOST_NOEXCEPT_OR_NOTHROW {}
4143

42-
char const* what() const throw()
44+
char const* what() const BOOST_NOEXCEPT_OR_NOTHROW
4345
{
4446
return boost::python::extract<char const*>(msg)();
4547
}

0 commit comments

Comments
 (0)