[C++-sig] conversion of std::list<...> parameters in function call

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Sun Jun 23 11:57:53 CEST 2002


--- Achim Domma <achim.domma at syynx.de> wrote:
> Is it ok to use this code in my (free) ImageMagick wrapper, if I mark it as
> based on work copyrighted by you and your university, or is there a license
> probem?

Please remove my list_or_tuple_as_tuple hack from your mind and your disk. It
is not appropriate for general consumption. Here is something better that works
with the latest CVS and that you may use without restrictions:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/cctbx/include/cctbx/bpl_utils.h?rev=1.2.2.13&only_with_tag=boost_python_v2_transition&content-type=text/vnd.viewcvs-markup

See also files
  bpl_utils.cpp
  container_from_list_or_tuple.cpp
  container_from_list_or_tuple.py
in:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/cctbx/misc/?only_with_tag=boost_python_v2_transition

The new code is based on PySequence_Fast and will be much more efficient than
the old code if you pass a list or tuple (because these are not copied any
longer).

To get started, look for "sequence_fast" in bpl_utils.h.

Did you have to write a new adoptor fr std::list<>? If so, could you please
post it?

David, please feel free to incorporate the sequence_fast class or any other
code from cctbx::bpl_utils into Boost.Python.

Ralf


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com





More information about the Cplusplus-sig mailing list