Re: Looking for intuitive explanation of complex template class!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
On 5/15/2013 4:08 PM, Haircuts Are Important wrote:
Here's another one that confuses me even more, please explain to me
what's happening? In particular, I'd like to know what W refers to.
I'd like an explanation of everything, if possible!
Sorry, I don't have an explanation of everything. You'll have to ask
your course instructor / teacher / professor for that.
[..]
template <class T, class p1>
{
T* W;
virtual void X (const p1& U) = 0;
}
I don't think it's valid code. A declaration is missing after the
closing angle bracket. There's supposed to be something like 'class
blah' or a function declaration (like 'void foo()'). The presence of
the 'virtual' hints that this block (between the two curly braces) is a
class definition, then 'W' is a data member of type 'T' (the first
template argument), and still 'class blah' is missing there. In that
case the closing curly brace is supposed to be followed by a semicolon.
Also, there are other syntax errors in your code. Perhaps you can take
a habit of copy-pasting the code into your messages instead of retyping
it...
V
--
I do not respond to top-posted replies, please don't ask