RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Jon Berndt
> Alistair K Phipps writes: > > > > or use vector< FGTable* > rather than vector< FGTable >, > > Yes I prefer using this form too > > Norman I made a few small changes to use the pointer as described above by Alistair. That took care of the problem. Thanks guys. Jon ___

RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Norman Vine
Alistair K Phipps writes: > > or use vector< FGTable* > rather than vector< FGTable >, Yes I prefer using this form too Cheers Norman ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f

RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Norman Vine
Jon Berndt writes: > > > Can you give a complete minimal example? I just tried the > > following one, and this compiles without problems, as it should: > > See below. > > > Are you *using* the assignment operator for your class > > somewhere? > > Not that I know of. see below > FGTable::FG

Re: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Alistair K Phipps
Jon Berndt wrote: Are you *using* the assignment operator for your class somewhere? Not that I know of. FGTable::FGTable(const FGTable& t) : PropertyManager(t.PropertyManager) { Tables = t.Tables; I think the problem is this assignment of vector< FGTable > which involves assignmen

RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Jon Berndt
> But I don't know at the moment, why Jons code doesn't work :( > > CU, > Christian For the moment, I'll just make it non-const. Jon ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f58

RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Jon Berndt
> Can you give a complete minimal example? I just tried the > following one, and this compiles without problems, as it should: See below. > Are you *using* the assignment operator for your class > somewhere? Not that I know of. > Cheers > -Gerhard Header file for FGTable: --- start --- #inc

RE: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Jon Berndt
> I think it complains the class has no constructor other than the > copy one. > > you should try to add one : > > class MyClass { > public: > MyClass(AnotherClass *p); // constructor > MyClass(const MyClass &mc); // copy constructor > > private: > AnotherClass* const ptrToAnotherClass;

Re: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Christian Mayer
Mathias Fröhlich schrieb: On Freitag 10 Dezember 2004 03:40, Jon Berndt wrote: This gives me an odd error: non-static const member `AnotherClass* const ptrToAnotherClass', can't use default assignment operator If I remove the const specifier from the declaration for ptrToAnotherClass, and then mov

Re: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Erik Hofman
Mathias Fröhlich wrote: That is something which is, I believe, missinterpreted by some compilers. You have a constant value and as such it cannot change. Initial assignment is a change and so you cannot assign that one. Your compiler seems to allow such an assignment for static members, but not f

Re: [Flightgear-devel] const and copy constructor

2004-12-10 Thread Gerhard Wesp
Hmm... Can you give a complete minimal example? I just tried the following one, and this compiles without problems, as it should: =< snip >== struct bar {} ; struct foo { foo( foo const& rhs ) : p( rhs.p ) {} bar* const p ;

Re: [Flightgear-devel] const and copy constructor

2004-12-09 Thread Mathias Fröhlich
On Freitag 10 Dezember 2004 03:40, Jon Berndt wrote: > This gives me an odd error: > > non-static const member `AnotherClass* const ptrToAnotherClass', can't use > default assignment operator > > If I remove the const specifier from the declaration for ptrToAnotherClass, > and then move the assign

Re: [Flightgear-devel] const and copy constructor

2004-12-09 Thread Frederic Bouvier
Jon Berndt wrote: > I have a situation where I am getting an error and I am not sure why. I have > a class > MyClass that has a copy constructor. The class has a private member that is a > const > pointer (the pointer is constant - not what the pointer points to): > > class MyClass { > public: >