|
-
March 17th, 2009, 10:44 AM
#8
Re: general purpose Singly-linked list implementation with inheritance
 Originally Posted by andrey_zh
Sorry, if someone understood that I'm working on implementation with templates. Templates are the thing I'm not interested in!
Here is what you stated in your first post:
I've found a good decision with templates, it looks natural and works good, but it's too long to write something like list->get_node()->get_data()->get_some_stuff()->set_value(value)
So my response to you is that you did not implement your template class correctly.
You say you need to do all of that work when you use templates, but at the same time, there is a linked list class that uses templates that doesn't need all of that. So what is your conclusion there? Why do you need to do so much work with your template implementation to set a value, and std::list doesn't need all that work?
It is not a part of a real program but a small exercise aimed to deeper learn C++
You really need to go back and see what you did wrong when you implemented your template "solution", since there is no need for all of that work, as proven by std::list.
Regards,
Paul McKenzie
Tags for this Thread
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
|