[C++-sig] returning reference to enum

Roman Yakovenko roman.yakovenko at gmail.com
Tue Nov 22 12:44:13 CET 2005


On 11/22/05, Emmanuel Taurel <etaurel at cells.es> wrote:
> Hello everybody,
>
> I have a very simple example where I try to wrap a C++ class. In this class
> there is a method which returns a reference to an internal variable which is
> an enumeration. I try to wrap this method with the return_internal_reference
> Call Policy but I have a compiler error.
>
> Any idea welcome. Thank's very much in advance

If you can change the class, then change it to return that enum value by value.
In this case you don't need to specify call policies.

If you can not to change it, then return_value_policy<
copy_non_const_reference > will do the job.

>
>
> Emmanuel Taurel (etaurel at cells.es)
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
>
>



More information about the Cplusplus-sig mailing list