|
[Sponsors] |
July 19, 2010, 17:23 |
List cannot be trusted...?
|
#1 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Why does setSize() trash my data?
I have: Code:
class: equationMaster { List<equation> eqns_; } Code:
class: equation : public List<operation> { // null constructor, friend operators << and >> // construct from components and IStream } Code:
class: operation { // four labels defined, some with enumeration // null constructor, friend operators << and >> // construct from components and IStream } Code:
eqns_.setSize(eqns_size() + 1); Anyone with any ideas what is going on? Have I overused lists? Any assistance would be appreciated... -Dave |
|
July 20, 2010, 04:04 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
Without actually knowing anything about your classes, you might nonetheless take a look at PtrList and see it that makes more sense for some of your operations. |
||
July 20, 2010, 11:26 |
|
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Thanks Mark. (I thought it might be a constructor issue.) I did switch to PtrList and it is behaving now.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
New List of Free CFD Codes | Bert Laney | Main CFD Forum | 5 | September 15, 1999 16:24 |