I am using library file Slist.h which has template declaration and definition.The library file is instantiated in the construtor
of mypgm.c(cpp file).The compiler throws an error which is mentioned at the bottom.
SList.h: In constructor 'SList<Object>::SList() [with Object = String]':
mypgm.c:131: instantiated from here
SList.h:85: error: no matching function for call to 'String::String(String)'
String.h:27: note: candidates are: String::String(String&)
SList.h:41: error: in passing argument 1 of 'SListNode<Object>::SListNode(const Object&, SListNode<Object>*) [with Object = String]'
SList.h: In constructor 'SListNode<Object>::SListNode(const Object&, SListNode<Object>*) [with Object = String]':
SList.h:85: instantiated from 'SList<Object>::SList() [with Object = String]'
mypgm.c:131: instantiated from here
SList.h:42: error: passing 'const String' as 'this' argument of 'String::operator char*()' discards qualifiers
make: *** [all]
I feel that the arguments are not passed correctly during instantion,i have tried to resolve this ,but my steps are in vain
i am new to template concept.could you please help me to resolve this issue.
Thanks for looking into this