TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jared
NA
1
0
Type for current class?
Apr 12 2008 7:33 PM
I think it's a long shot but I figure I'd ask if this was possible just in case.
Does anyone know of some way to specify the current class type similar to the way you would use generics? Hard to word, example:
class Example
{
public Example DefaultExample;
}
only instead of stating the class explicitly, I would like some implicit way to do it such as:
class Example
{
public <T> DefaultExample;
}
So that child classes would automatically have a DefaultExample member of their own class type:
class ExampleChild : Example
{
void DoChildStuff()
{
Default.DoChildStuff()
}
}
i can sort of achieve this by doing the following:
class ExampleBase<Type>
{
public Type DefaultExample;
}
class ExampleChild : ExampleBase<ExampleChild>
{
}
class ExampleChildChild : ???
{
}
but obviously the inheritance breaks after the first level
Any ideas or is this just not feasible?
Reply
Answers (
1
)
Software recognition
Shape area in images