[C++-sig] need 16 arguments to a function...

Stefan Seefeld seefeld at sympatico.ca
Sat Nov 25 17:26:13 CET 2006


anders langlands wrote:
> Can I change the max arguments limit for methods without recompiling
> boost::python? I need an initializer for a 4x4 matrix, hence the need
> for 16 floats.

FWIW, I have used hand-coded construction / conversion code to generate
C++ containers ('Vector', here) from python lists, such as this:

std::auto_ptr<Vector> construct_vector(bpl::list l)
{
  long len = bpl::extract<long>(l.attr("__len__")());
  std::auto_ptr<Vector> vector(new Vector(len));
  for (long i = 0; i != len; ++i) vector->put(i, bpl::extract<double>(l[i]));
  return vector;
}

May be something similar would work for you, too ?

HTH,
		Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list