[linux-audio-dev] templates - little bit OT

From: conrad berhörster <conrad.berhoerster@email-addr-hidden>
Date: Thu Jan 19 2006 - 01:41:58 EET

Hello,
maybe the c++ gurus out there have an idea. currently i think it is
unpossible.

i try to use a template a a class member variable, like that:
asume a template matrix class

template < int cols, int rows>
class matrix {
 // implementation

}

everything works fine when i'm doing something like
matrix<<3,4> mymat;
matrix <5,5> quad;

but now i try to do it a little more generic i try to build a class, which
have a member of this matrix like
class MyClass
{
  MyClass();
 MyClass(n,n);
private:
  matrix<n,n>
};

this means, at runtime, i want to set the size of the matrix. is this
possible? this are divers concepts (templates and runtime) , aren't they?

thanks c~
Received on Thu Jan 19 04:15:08 2006

This archive was generated by hypermail 2.1.8 : Thu Jan 19 2006 - 04:15:08 EET