I think you are saying that your code fails for the case "linkedlist<SmartPtr<MyClass> >"?
It is
worth reading more on templates, since some of the concepts involved are not trivial. The STL library already has linked lists, and it can handle most classes (as long as they have appropriate constructors and comparison operators).
If you have specific issues, perhaps you could provide code fragments so that others can suggest improvements and ways of dealing with errors.