Luis,
The error message from the compiler is correct.
You need to include the template argument list
for class template StructuredMesh when you use it:
template<class T_number, int Dim>
class StructuredMesh : public Mesh<StructuredMesh<T_number,Dim> > { /* ...
*/ };
Regards, Julian C.
Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
cummings@cacr.caltech.edu
> -----Original Message-----
> From: owner-oon-list@oonumerics.org
> [mailto:owner-oon-list@oonumerics.org]On Behalf Of Luis Miguel De La
> Cruz Salas
> Sent: Thursday, September 06, 2001 10:51 AM
> To: oon-list@oonumerics.org
> Subject: OON: Barton & Nackman Trick
>
>
>
> Hi,
> someone knows if the Barton & Nackman Trick works fine in SGI MIPS
> Pro compiler?.
>
> I'm tryin to compile the next code:
> ---------------------------------------------------------------------
> template<class T_mesh>
> class Mesh {
> public:
> Mesh() {
> Dimension = asLeaf().getDimension();
> cout << " Mesh: Dimension = " << Dimension
> << endl; }
>
> ~Mesh() {}
>
> T_mesh& asLeaf() { return static_cast<T_mesh&>(*this); }
>
> protected:
> int Dimension;
> };
>
> template<class T_number, int Dim>
> class StructuredMesh : public Mesh<StructuredMesh> {
> public:
> StructuredMesh() {
> Dimension = Dim;
> cout << " StructuredMesh: Dimension = " <<
> Dimension << endl; }
>
> ~StructuredMesh() {};
>
> int getDimension() { return Dim; }
>
> };
>
> // in main.cc
> ...
> StructuredMesh <double, 3> grid;
> ...
> ---------------------------------------------------------------------
> This is the error I get:
>
>
> cc-1420 CC: ERROR File = ./../include/StructuredMesh.h, Line = 38
> An argument list for class template "StructuredMesh" is missing.
>
> class StructuredMesh : public Mesh<StructuredMesh>
> ^
>
> cc-1420 CC: ERROR File = ./../include/StructuredMesh.h, Line = 38
> An argument list for class template "StructuredMesh" is missing.
>
> class StructuredMesh : public Mesh<StructuredMesh>
> ^
> detected during instantiation of class "StructuredMesh<double,
> 3>"
> at line 32 of "./prueba.cpp"
>
> 2 errors detected in the compilation of "./prueba.cpp".
> make: *** [prueba.o] Error 2
>
>
> Thanks in advance,
>
> Luis M. de la Cruz
>
> --------------------- Object Oriented Numerics List
> --------------------------
> * To subscribe/unsubscribe: use the handy web form at
> http://oonumerics.org/oon/
> * If this doesn't work, please send a note to
> owner-oon-list@oonumerics.org
>
--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:16 EST