toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] resize in dynamic vectors/matrices ?


From: Gerhard Reitmayr
Subject: [Toon-members] resize in dynamic vectors/matrices ?
Date: Wed, 15 Apr 2009 15:30:38 +0100

Hi Tom and Ed (and everyone else),

while trying to port gvars3 to TooN2, I found that resize() and default constructors on dynamic vectors and matrices are missing. Both are necessary for the current mechanics in gvars3 which creates maps between names and instances of these types and uses default constructors in various places. resize is also necessary to assign to the instance in the map, because otherwise assignment will often fail.

I added resize to both in the attached allocator.hh file and it works nicely with gvars3.

Discussing this with Ed, we are not sure, if we want a resize in the dynamic ones? Ed mentioned the idea of another type which is resizable. One issue with that is, that if resizable would not be default, the interface to gvars3 (which would have to use the resizable ones) might be more error prone.

What does everyone thing would be best solution ?
- add resize as I did
- add a resizable vector/matrix type ?
- larger hack to gvars3 to make it work with pointers to instances and swivel them around ?

cheers,
  Gerhard
--
Gerhard Reitmayr
MIL, Engineering Department, Cambridge University
http://mi.eng.cam.ac.uk/~gr281/

Attachment: allocator.hh
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]