2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

std::complex<> fixes for MSVC

[SVN r9418]
This commit is contained in:
Dave Abrahams
2001-03-04 15:56:38 +00:00
parent a3f822b7d3
commit af6cfd0ea8

View File

@@ -7,7 +7,8 @@
// producing this work.
//
// Revision History:
// Mar 03 01 added: converters for [plain] char (Ralf W. Grosse-Kunstleve)
// 04 Mar 01 std::complex<> fixes for MSVC (Dave Abrahams)
// 03 Mar 01 added: converters for [plain] char (Ralf W. Grosse-Kunstleve)
#include <boost/python/conversions.hpp>
#include <typeinfo>
@@ -47,6 +48,19 @@ void handle_exception()
}
}
namespace detail {
void expect_complex(PyObject* p)
{
if (!PyComplex_Check(p))
{
PyErr_SetString(PyExc_TypeError, "expected a complex number");
throw boost::python::argument_error();
}
}
} // namespace boost::python::detail
}} // namespace boost::python
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE