[C++-sig] Can't get a simple example with fstream to compile & link

Fast Bike cdn_pride at yahoo.com
Fri May 23 18:01:11 CEST 2003

I guess what I was trying to ask is: Why is a copy
constructor needed for everything?

For example if I want to open a member file object
within the constructor of the object I am wrapping and
close it within the destructor that seems good and
normal to me. However, without making it a pointer to
a file object I can't because the boost::python
library wants to copy it.

I don't understand why it would need to make a copy of
it. That's the part I'm trying to understand.

Thanks for your help.

--- Stefan Seefeld <seefeld at sympatico.ca> wrote:
> Fast Bike wrote:
> > Opps, I messed up when cutting and pasting my
> example
> > out of a larger sample.
> > 
> > The constructor shouldn't start to initialize
> > variables and should read:
> > 
> > PythonWrapper(int id) { myid = id; };
> It's generally preferable to use the initializer
> list instead of doing
> assignment within the constructor body.
> Stefan
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig

Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

More information about the Cplusplus-sig mailing list