type_caster<std::function>: allow None values in both directions
diff --git a/example/example-callbacks.cpp b/example/example-callbacks.cpp
index afb864d..a5a3b83 100644
--- a/example/example-callbacks.cpp
+++ b/example/example-callbacks.cpp
@@ -38,7 +38,10 @@
int dummy_function(int i) { return i + 1; }
int dummy_function2(int i, int j) { return i + j; }
std::function<int(int)> roundtrip(std::function<int(int)> f) {
- std::cout << "roundtrip.." << std::endl;
+ if (!f)
+ std::cout << "roundtrip (got None).." << std::endl;
+ else
+ std::cout << "roundtrip.." << std::endl;
return f;
}