[C++-sig] Arrays and Boost.Python

David Abrahams dave at boost-consulting.com
Fri Mar 28 18:11:41 CET 2003


Patrick Hartling <patrick at vrac.iastate.edu> writes:

> Does Boost.Python (from Boost 1.30.0 or the Boost CVS trunk) provide
> handling of arrays as public data members in a C++ class?  Using
> Boost.Python from Boost 1.30.0, I get an error from GCC 3.2 about line
> 68 of boost/python/data_members.hpp stating that "ISO C++ forbids
> assignment of arrays."  If I change the array definition in my
> Boost.Python code so that the data member is read-only instead of
> read/write, that gets rid of the error.  

But I doubt it will do anything other than raise an exception when
you try to use it from Python.

> I don't mind doing that in this case--really I am just curious about
> how Boost.Python handles C++ arrays.

So far, it doesn't.  If you can write down precisely what semantics
you'd like to see, considering what would constitute an argument match
for overloaded functions, we might be able to do something about it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list