On Fri, 12 Nov 2004 11:18:05 -0800, Gianni Mariani wrote:
Daniel L Elliott wrote: Hello,
I want to have a class which can contain vectors of many different types
(int, double, Complex, etc).
Is it possible to have a generic vector inside a non-template class?
How would you use the class ?
Perhaps boost::any is somthing like what you're looking for ?
Thank you for your response. Here is a brief description of my usage:
I have a set of transformations. Each is represented by a class which
contains a matrix (uBLAS) which may contain int,float,Complex,etc.
However, transformations are applied by passing images into the class and
therefore the data type of the internal matrix does not really matter.
Can I make the matrix data member generic (template) while not having a
template parameter for the matrix contents (int, float, Complex, etc.)?
Some tranformations are best represented as a matrix of integers while
others must be float. However, I would like them all to fall under the
same data type.
Thank you very much for all responses!
- dan