Chris Forone wrote:
i have a class as template parm for another class. in ctor of the
parameterized class i use a local instance of class from parm. ctor of
param-class compiles fine, but i cant call members.
Lemme see if I can imagine what you're doing...
error: request for member `Decode' in `image [with T = Targa]', which is
of non-class type `Targa ()(std::istreambuf_iterator<char,
std::char_traits<char)
template<class Tclass image {
public:
image() {
T t;
t.Decode();
}
};
class Targa {
public:
void Decode() {}
};
int main() {
image<Targait;
}
Well, this should work, more or less. But how do you get the error
message with such content. I can only think that you must have
forgotten to use parentheses or used too many of them...
image() {
T t(); // t is a *function*
t.Decode(); // cannot use 't' here!!!
}
So, if you are trying to declare 't' here, drop the parentheses.
>
thanks & hand, chris
ps/ot: are you interested in uefa european-championship (em)?
Nope.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask