aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/pair_conversions.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-10-26 19:43:43 -0200
committerHugo Lima <hugo.lima@openbossa.org>2009-10-27 11:37:26 -0200
commit46619953316a8bc7b5cfc5ac5536187658069273 (patch)
tree5313b0fd05e5a42e883aac5a0b9aaca7c5f145a8 /tests/samplebinding/pair_conversions.h
parente7e527ad998fa9c2dbb7d8bf93d105e7b916e755 (diff)
Added Converter<T>::isConvertible to replace the T_Check functions.
This allow the user to full custommize the type conversion. Note: This change added a known regression on test_derived
Diffstat (limited to 'tests/samplebinding/pair_conversions.h')
-rw-r--r--tests/samplebinding/pair_conversions.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/samplebinding/pair_conversions.h b/tests/samplebinding/pair_conversions.h
index d5f1431ca..aae68d061 100644
--- a/tests/samplebinding/pair_conversions.h
+++ b/tests/samplebinding/pair_conversions.h
@@ -1,6 +1,10 @@
template <typename StdPair>
struct Converter_std_pair
{
+ static bool isConvertible(const PyObject* pyObj)
+ {
+ return PySequence_Check(const_cast<PyObject*>(pyObj));
+ }
static PyObject* toPython(StdPair holder)
{
typename StdPair::first_type first(holder.first);