Re: Problems using Matrix Type in class definition with MSVC 6.0
Sven Olsen <[email protected]> Tue, 06 Jul 2004 10:05:58 -0400
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <[email protected]> |
You've tried to put constructor arguments at the end of a member variable
declaration (and that's wrong). You should be using an initializer
list. What you want here is:
class KoPoint
{
public:
Matrix A;
KoPoint() : A(3,3) {}
};
At 01:32 PM 7/5/2004 +0000, you wrote:
>Hi,
>
>please check out the following code sample which results in the compiler
>error
>
>error C2059: Syntaxerror : 'constant'
>
>pointing to the line where the Matrix A ist generated.
>
>I am the opposite of an expert in c++, so it might be that its just
>something really stupid.
>Thanks in advance and best regards!
>
>Timo
>
>
>#include <stdio.h>
>#include <fstream.h>
>#include <iostream.h>
>#include <stdlib.h>
>#include <string.h>
>#include <math.h>
>
>#pragma warning (disable: 4786)
>
>
>#include <mtl/matrix.h>
>#include <mtl/mtl.h>
>#include <mtl/utils.h>
>
>using namespace mtl;
>
>typedef matrix< double, rectangle<>, dense<>, row_major>::type Matrix;
>
>//main
>class KoPoint
>{
>public:
> Matrix A(3,3);
>};
>
>KoPoint Point;
>void main()
>{
>}
>
>
>_______________________________________________
>This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/