Neal Becker
2010-09-24 13:22:01 UTC
It seems without this an invalid vector is constructed, so that e.g.
pyublas::numpy_vector<int> u;
boost::size(u);
causes segfault.
diff --git a/src/cpp/pyublas/numpy.hpp b/src/cpp/pyublas/numpy.hpp
index 8c7bb82..391b078 100644
--- a/src/cpp/pyublas/numpy.hpp
+++ b/src/cpp/pyublas/numpy.hpp
@@ -730,6 +730,7 @@ namespace pyublas
public:
numpy_vector ()
+ : super(0)
{ }
// observe that PyObject handles are implicitly convertible
pyublas::numpy_vector<int> u;
boost::size(u);
causes segfault.
diff --git a/src/cpp/pyublas/numpy.hpp b/src/cpp/pyublas/numpy.hpp
index 8c7bb82..391b078 100644
--- a/src/cpp/pyublas/numpy.hpp
+++ b/src/cpp/pyublas/numpy.hpp
@@ -730,6 +730,7 @@ namespace pyublas
public:
numpy_vector ()
+ : super(0)
{ }
// observe that PyObject handles are implicitly convertible