[C++-sig] Re: iterator interface question

Neal D. Becker nbecker at hns.com
Fri Jan 30 16:59:24 CET 2004


My question is really generic.  I have lots of C++ algorithms written in STL
style.  They pass containers as pairs of iterators.

Consider the generic algorithm X:

template<typename in_t, typename out_t>
void X (in_t in, in_t inend, out_t out);

Now I have exposed std::vector<double> (for example) to python, so python
can create a std::vector<double> like:

x = DVec (10)

But what I want to know, how can python call algorithm X, which expects a
pair of iterators?

Since STL became widely used, it is increasingly common to write algorithms
in this style, so I hope there is a way to do this.







More information about the Cplusplus-sig mailing list