-
October 13th, 2013, 05:43 AM
#1
[RESOLVED] template for events
i'm doing these template:
Code:
template <class T, class A>
class events : public T
{
public:
events(){}
~events(){}
bool operator==( const T& aTee ) const // Explicit cast
{ return (aTee == *(static_cast<T*>(this))); }
const T* getTpart() const { return this; } // Implicit cast
}A;
but i get some errors:
"C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|15|error: declaration of 'events<T, A> A'|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|6|error: shadows template parm 'class A'|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|15|error: template declaration of 'events<T, A> A'|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 2 seconds) ===|"
why, in normal class, i use 'A' without a problem and here i get errors?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|