aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkconverter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkconverter.cpp')
-rw-r--r--sources/shiboken2/libshiboken/sbkconverter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/shiboken2/libshiboken/sbkconverter.cpp b/sources/shiboken2/libshiboken/sbkconverter.cpp
index a13222de6..4f6ebf65f 100644
--- a/sources/shiboken2/libshiboken/sbkconverter.cpp
+++ b/sources/shiboken2/libshiboken/sbkconverter.cpp
@@ -78,7 +78,8 @@ void init()
Primitive<unsigned int>::createConverter(),
Primitive<unsigned long>::createConverter(),
Primitive<unsigned short>::createConverter(),
- VoidPtr::createConverter()
+ VoidPtr::createConverter(),
+ Primitive<std::nullptr_t>::createConverter()
};
PrimitiveTypeConverters = primitiveTypeConverters;
@@ -100,6 +101,7 @@ void init()
converters["unsigned long"] = primitiveTypeConverters[SBK_UNSIGNEDLONG_IDX];
converters["unsigned short"] = primitiveTypeConverters[SBK_UNSIGNEDSHORT_IDX];
converters["void*"] = primitiveTypeConverters[SBK_VOIDPTR_IDX];
+ converters["std::nullptr_t"] = primitiveTypeConverters[SBK_NULLPTR_T_IDX];
initArrayConverters();
}
@@ -246,10 +248,8 @@ PythonToCppFunc isPythonToCppPointerConvertible(SbkObjectType *type, PyObject *p
static inline PythonToCppFunc IsPythonToCppConvertible(const SbkConverter *converter, PyObject *pyIn)
{
assert(pyIn);
- const ToCppConversionList& convs = converter->toCppConversions;
- for (ToCppConversionList::const_iterator conv = convs.begin(), end = convs.end(); conv != end; ++conv) {
- PythonToCppFunc toCppFunc = 0;
- if ((toCppFunc = (*conv).first(pyIn)))
+ for (const ToCppConversion &c : converter->toCppConversions) {
+ if (PythonToCppFunc toCppFunc = c.first(pyIn))
return toCppFunc;
}
return 0;
@@ -361,7 +361,7 @@ bool isImplicitConversion(SbkObjectType *type, PythonToCppFunc toCppFunc)
// Note that we don't check if the Python to C++ conversion is in
// the list of the type's conversions, for it is expected that the
// caller knows what he's doing.
- ToCppConversionList::iterator conv = PepType_SOTP(type)->converter->toCppConversions.begin();
+ const auto conv = PepType_SOTP(type)->converter->toCppConversions.cbegin();
return toCppFunc != (*conv).second;
}