c++-sig@python.org
[Top] [All Lists]

Re: [C++-sig] Boost.Python call policies at runtime...

Subject: Re: [C++-sig] Boost.Python call policies at runtime...
From: Stefan Seefeld
Date: Thu, 09 Nov 2006 11:34:40 -0500
Kevin Jones wrote:
> Hi all,
> 
> Given a class called Variant that can (at runtime)
> contain either an int or a T*. 
> 
> I.E. 
>   class Variant {
>     public:
>       int type;
>       union {
>         int i;
>         T* t;
>       };
>   };

What is 'T' ?

> How can I create a call policy that uses
> return_by_value when Variant is an int or
> manage_new_object when Variant is a T* (based on the
> value of "type" at runtime)?

What do you want to call that returns either of the two ?

> Note: I need to wrap either the int as a python object
> or T* as a python object and not Variant.

You have given far too little information about what you
want to do (both in C++ as well as python) for anybody to
be able to help.


Regards,
                Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...
_______________________________________________
C++-sig mailing list
C++-sig@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/c++-sig

<Prev in Thread] Current Thread [Next in Thread>