ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] Iterators for heterogeneous container
by Thomas Daniel other posts by this author
Nov 5 2009 11:10PM messages near this date
Re: [C++-sig] Python extension for Windows failing on import | Re: [C++-sig] Iterators for heterogeneous container
I am having trouble wrapping a container that can hold multiple object 
types and therefore has multiple iterator types.

My C++ library has these classes:

class Tomato;
class Potato;
class Garden {
    Iter<Tomato>    get_tomatoes();
    Iter<Potato>    get_potatoes();
};

template<class T> 
class Iter {
    T get_next();
};

which allows to write:

Iter<Potato>  potatoes = garden.get_potatoes();
while (Potato potato = potatoes.get_next()) {
   cout << potato.name();
}

I am trying to use boost to wrap it so that I can write in python:

for potato in garden.get_potatoes():
   print potato.name()

Any pointers how to achieve this with boost?





_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@[...].org
http://mail.python.org/mailman/listinfo/cplusplus-sig
Thread:
Thomas Daniel
Michele De Stefano
Thomas Daniel
Troy D. Straszheim
Thomas Daniel

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved