-
July 3rd, 2005, 02:28 PM
#1
Is this legal?
Hi folks!
I came around a construct that works, but is a bit strange, to put it mildly. I was wondering if it is legal. I didn't dive into the Standard -- I didn't have the time... Here it is:
Code:
template <typename T>
class A {/*...*/};
class B:public A<B> {/*...*/};
If you wonder what that's good for: 'A' implements common operations on a container which contains pointer-to-members of B. Sort fo hard to explain. I wasn't able to find a reason why this shouldn't work. OTOH it really doesn't look very healthy...
Looking forward to reding your comments...
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
|