Complaint about missing call policies, when they are in fact specified

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Complaint about missing call policies, when they are in fact specified

Davidson, Josh
I'm adding return value call policies to methods of a class as follows:
        mb.class_("SerialStore").member_functions(lambda decl: decl.name.startswith("getSim")).call_policies = \
            call_policies.return_internal_reference()

--------------------------------------------------------------------------------------------------------------------------

During generation, I get the following warning:
WARNING: boost::container::list<unsigned char,boost::interprocess::allocator<unsigned char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ull>, boost::interprocess::iset_index> > > * SerialStore::getSimicsInput() [member function]

> compilation error W1050: The function returns

> "boost::container::list<unsigned

> char,boost::interprocess::allocator<unsigned char,

> boost::interprocess::segment_manager<char, boost::interprocess::rbtree

> _best_fit<boost::interprocess::mutex_family,

> boost::interprocess::offset_ptr<void>, 0ull>,

> boost::interprocess::iset_index> > > *" type. You have to specify a

> call policies.Be sure to take a look on `Py++` defined call policies

--------------------------------------------------------------------------------------------------------------------------

Here is the generated code for that method that appears to have the call policy specified:
        { //::SerialStore::getSimicsInput
       
            typedef ::boost::container::list<unsigned char,boost::interprocess::allocator<unsigned char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ull>, boost::interprocess::iset_index> > > * ( ::SerialStore::*getSimicsInput_function_type )(  ) ;
           
            SerialStore_exposer.def(
                "getSimicsInput"
                , getSimicsInput_function_type( &::SerialStore::getSimicsInput )
                , bp::return_internal_reference< >() );
       
        }
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: Complaint about missing call policies, when they are in fact specified

Roman Yakovenko
On Mon, Dec 19, 2011 at 9:01 PM, Davidson, Josh <[hidden email]> wrote:

> I'm adding return value call policies to methods of a class as follows:
>        mb.class_("SerialStore").member_functions(lambda decl: decl.name.startswith("getSim")).call_policies = \
>            call_policies.return_internal_reference()
>
> --------------------------------------------------------------------------------------------------------------------------
>
> During generation, I get the following warning:
> WARNING: boost::container::list<unsigned char,boost::interprocess::allocator<unsigned char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ull>, boost::interprocess::iset_index> > > * SerialStore::getSimicsInput() [member function]
>
>> compilation error W1050: The function returns
>
>> "boost::container::list<unsigned
>
>> char,boost::interprocess::allocator<unsigned char,
>
>> boost::interprocess::segment_manager<char, boost::interprocess::rbtree
>
>> _best_fit<boost::interprocess::mutex_family,
>
>> boost::interprocess::offset_ptr<void>, 0ull>,
>
>> boost::interprocess::iset_index> > > *" type. You have to specify a
>
>> call policies.Be sure to take a look on `Py++` defined call policies
>
> --------------------------------------------------------------------------------------------------------------------------
>
> Here is the generated code for that method that appears to have the call policy specified:
>        { //::SerialStore::getSimicsInput
>
>            typedef ::boost::container::list<unsigned char,boost::interprocess::allocator<unsigned char, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ull>, boost::interprocess::iset_index> > > * ( ::SerialStore::*getSimicsInput_function_type )(  ) ;
>
>            SerialStore_exposer.def(
>                "getSimicsInput"
>                , getSimicsInput_function_type( &::SerialStore::getSimicsInput )
>                , bp::return_internal_reference< >() );
>
>        }

Please open a bug on sorceforge with the source code to reproduce it.
Meanwhile, py++ provides functionality to disable warnings ( for the
concrete declaration ) - just use it.

Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig