Topic: template problems


Author: Douglass Davis <dougd@lennon.cc.gatech.edu>
Date: 1997/08/29
Raw View
I have a vector type, which is four floats:
typedef float vectype[4];


The essence of my problem is because I can not do this:

vectype* foo;
foo= new vectype;

(which works with any other type)


I have a another Vector class which is an array that grows.

it has an operator [] function that returns a reference to the type
specified.


I can not do Vector <vectype> because of the previous problem.  With
classes, structs or elementary types it works, it just does not work
with
arrays.  Does any one know of a way that, say, float[4] could be passed
to a Vector class using a template, and it would work like a regular
vector?


   -Douglass Davis (dougd@cc.gatech.edu)


      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]