Commit 49916ff3 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Add to_std_vector

parent 95b27447
......@@ -17,7 +17,7 @@ namespace bp = boost::python;
namespace dynamicgraph {
namespace python {
template <typename Iterator>
template <typename Iterator> inline
bp::list to_py_list(Iterator begin, Iterator end) {
typedef typename Iterator::value_type T;
bp::list lst;
......@@ -25,11 +25,18 @@ bp::list to_py_list(Iterator begin, Iterator end) {
return lst;
}
template <typename Iterator>
template <typename Iterator> inline
bp::tuple to_py_tuple(Iterator begin, Iterator end) {
return bp::tuple(to_py_list(begin, end));
}
template<typename T> inline
std::vector< T > to_std_vector( const bp::object& iterable )
{
return std::vector< T >( bp::stl_input_iterator< T >( iterable ),
bp::stl_input_iterator< T >( ) );
}
void exposeSignals();
// Declare functions defined in other source files
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment