Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

E2316 'not a member' in a template class - any ideas?

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
Hallo.
I'm afraid I'm having more trouble with templates.
I can define in a class called &quot;Tconsole_script&quot; (that inherits from vector<T>) the following:
virtual void LoadFromFile(T& fullfname)'
This seems okay, but when I put an implementation in the .cpp file, the compiler tells me this:
ftp_console.cpp(36): E2316 'Tconsole_script<T>::LoadFromFile(T&)' is not a member of 'Tconsole_script<T>'
And it is! IT IS! I PUT IT THERE MYSELF!
I'm afraid this is foxing me quite severely.
If anybody can figure it, I'll be eternally grateful!
Cheers,
Douglas JL

Common sense is what tells you the world is flat.
 
Quick follow up:
A rather unattractive solution to this is to put all of the implementation code in the header file with the definition.
This does make the program work, but is very ungainly, so if anybody knows a better way to solve this then I'd still really appreciate their input.
Cheers,
Douglas JL

Common sense is what tells you the world is flat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top