Boost logo

Boost :

From: Phlip (pplumlee_at_[hidden])
Date: 2001-03-23 17:38:09


Proclaimed David Abrahams from the mountaintops:
> > -----Original Message-----
> > From: Karl Bellve [mailto:Karl.Bellve_at_[hidden]]
> >
> > I am still having some issues with using Boost, Python and C++.
> >
> > I want to be able to export a specific instance of a class to Python.
> > I don't want to load a new instance of the class inside Python. Is
> > this possible?
>
> What does "load a new instance of the class inside Python" mean? I don't
> think I can answer your question unless you use terms I can understand.

He needs something like this:

auto_ptr<class> function () {
    return new class;
    }

The difference is C++ constructs the object, not Python.

I spawned a thread asking this question many moons ago. The OP is advised
to Google for my distinctive street name and auto_ptr and shared_ptr to
learn the tricks and traps here. I recall that the 'build_class<>' or
whatever template must appear above a function like this or else
'to_python' won't find enough traits to go on.

-- 
  Phlip                          phlip_cpp_at_[hidden]
============== http://phlip.webjump.com ==============
  --  MCCD - Microsoft Certified Co-Dependent  --

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk