Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!munnari!vuwcomp!windy!srwmrbd From: srwmrbd@windy.dsir.govt.nz (ROBERT) Newsgroups: comp.lang.c++ Subject: Re: Continuing efforts ... Message-ID: <2062@windy.dsir.govt.nz> Date: 5 Dec 88 14:50:10 GMT Organization: DSIR, Wellington, NZ Lines: 33 baud@gt-eedsp.UUCP (Kurt Baudendistel) writes (<575@gt-eedsp.UUCP>) >>In my attempts to write an array package to solve this problem I have >>two classes of array, eg IA and tIA. The IA class has the usual >>constructors and destructors. However the tIA class has no destructor >>and the rule is that anything that uses a tIA object must destroy it or >>recycle its space. ... >Well, this is a passable method for implementation, but it gets out of >hand very quickly. Try adding sub-array constructs to this method---to >do it you have to add yet another data type. Then there are vectors. How >many vector types do you need? how about all of those conversions and >dummy member functions?!!! >After some experiment, I've decided that a run-time (rather than a >compile- time) method is easier to implement and much less costly in >terms of complexity of the class definition. Hopefully, the gnu c++ >library will release a good array package to the masses early next year >(january?) so we can forget about these types of discussions. I presume the runtime package includes a Boolean variable in the array definition which indicates whether the space may be recycled. I started out along those lines and then switched to the two class approach because it seemed as though the C++ compiler could do the administration. You need about the same code in each case but the C++ compiler has to work a lot harder in my case (really too hard on a PC running Glockenspiel). Either approach reduces the amount of copying that a naive array package would use - and this was the point of the original comment. Hopefully Gnu C++ will release a good array package - but if it is Gnu won't that mean we can't use it on confidential or commercial projects?