*************************************************************************
Mike
Marchywka
EyeWonder
Instant Streaming, Infinite Results
1447
Peachtree Street
9th Floor
Atlanta, GA
30309
w.678-891-2033
c.
h.770-565-8101
mmarchywka@eyewonder.com
alt:
marchywka@hotmail.com
Instant Streaming, Intelligent
results.
*************************************************************************
-----Original Message-----Sorry to trouble you all again, but it seems that I can't get the Barton-Nackman trick to work. I had problems originally, so tried a simple test problem .. which worked, but my original problem is not working. My inheritance is like this,
From: oon-list-bounces@oonumerics.org [mailto:oon-list-bounces@oonumerics.org]On Behalf Of Hari Sundar
Sent: MondayMarch-27-2006 02:33 PM
To: oon-list@oonumerics.org
Subject: Re: [oon-list] Static Polymorphism
Class A {
protected:
float * some_data;
int x;
int y;
int z;
}
template <typename T>
Class B : public A
{
public:
T& asLeaf() { return static_cast<T&>(*this); }
inline float SomeFunc(int i, int j, int k) {
return asLeaf().SomeFunc(i,j,k);
}
}
class C : public B<C>
{
inline float SomeFunc(int i, int j, int k) {
return some_data[k*x*y + j*x + i];
}
}
When I use gcc to compile this .. I get errors of the sort ..
error: 'some_data' was not declared in this scope
error: 'x' was not declared in this scope
error: 'y' was not declared in this scope
Any ideas ?
thanks,
~Hari