This code works fine ....
But i want the Definition of the function not in the main class , i want to put it outside function ...... If i do that ..... It is giving error ..... Please provide some solution(s)...
You didn't post the code that doesn't work, but I guess that you want to define the method template in a separate file rather than in the definition of the class, as one often does for normal class methods.
Short answer; you can't.
There is, no doubt, a better explanation in a text book somewhere, but here goes...
Templates are not like normal code; you cannot define them where ever you like. When the compiler sees your call to
here is no method with signature
so it has to create one from the template you supplied. This means that the compiler has to be able to see the both the template (so it knows how to build the function) and the call (so it knows what types to build the function with) at the same time. So the template and the code calling the method must be in the same compilation unit.
You don't have to have the method template defined inline, but you must have it defined where the class is defined.
Hello All,
I have installed cacti and I have Nan values on created graph.
I really appreciate any help.
I have done the following:
1. Linux Ubuntu 12.04.2 LTS 64 bits
2. apt-get install cacti // the cacti Version 0.8.7i was installed
3. Accessed "http://MyIP/cacti/index.php"
4. Set SNMP... (0 Replies)
Hello Again,
I am just wanted to know if we can call the Template using "require_once" at PHP?
Any views around happy to discuss.
Thanks in Advance (2 Replies)
I get some compiling errors about template instantiation :wall: , but I can't find where the syntax errors happens. Can some help me?
template<typename Type> class SingleList;
template<typename Type> class SingleListNode{
private:
friend class SingleList<Type>;
SingleListNode() :... (1 Reply)
hi experts,
i'm trying to do this:
file1 is a template. might have kinds of 'funny' characters.
sample:
<body>
<form>
<p><input type="text" name="abc"/></p>
<p><my_content></p>
</form>
</body>
file2 is a file that contains lots of text. this might be very big. might have... (2 Replies)
Hello.
I want to copy temp files when I make a new file by vi.
For example,
09:32:52 ~/ $ mkdir test
09:33:03 ~/ $ cd test/
09:33:09 ~/test/ $ ls
09:33:16 ~/test/ $ vi test.cpp
09:34:37 ~/test/ $ cat test.cpp
#include <iostream>
int main()
{
}
09:34:48 ~/test/ $ vi test.bash
09:35:19... (1 Reply)
Hi, i have class template,
1)can i override the copy constructor
2)can we have virtual function in class template
if not plz tel why? I tried , compile error comes for me...
Thanks
Sarwan (0 Replies)