September 6th, 2011, 08:13 AM
Library and Template Trouble
I am trying to implement a generic smart pointer library which links to another main program. To make the smart pointer library generic I am using a template with a typename called "type". However, when I attempt to link my library to the main program and compile them both, I get a compiler error which says something like "Expected type, got link" (where "link" is a class in the main program).
I was wondering why this is happening and what I can do to fix it. I've tried passing my smart_pointer an "int" type and this works fine.
smart_pointer<int> p = new int(); // Works okay!
smart_pointer<link> l = new link(); // Does not work! (Compiler: "Expected type, got link")
I've included my code below (not all of it, but just the parts I think are relevant). Also, I'm not supposed to alter the main program in any way (just my library).
Any help would be greatly appreciated.
EDIT: Please refer to the code on the third post below this one.
Last edited by ace_of_pentacles; September 6th, 2011 at 10:16 PM.
Reason: Updating inadequate code.
Tags for this Thread
Click Here to Expand Forum to Full Width