[C++-sig] working with raw const pointers

David Abrahams dave at boostpro.com
Thu Jul 17 20:51:17 CEST 2008


on Thu Jul 17 2008, Gennadiy Rozental <rogeeff-AT-gmail.com> wrote:

> Problem I. Access to mutable func 
>
> Following python statement 
> mymodule.boo( mymodule.make_non_const_a() ) 
>
> seems to call incorrect function boo

Python has no notion of "const", only immutability.  Accordingly,
Boost.Python has no notion of const either.  Maybe it should, but it
doesn't.

> Problem II. Vector fails completely 
>
> Following python statements
>
> vec = pytoolkit.make_vec();
> for e in vec: pass
>
> produce
>
> TypeError: No to_python (by-value) converter found for C++ type: class A const *

This has something to do with the vector_indexing_suite.  Probably we
could add a remove_const somewhere and get it to work.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



More information about the Cplusplus-sig mailing list