![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 377
Rep Power: 0
![]() |
Template Questions
I just have a few questions about templates. I will just use the following class as an example to use for my questions:
template <class T>
class MyClass
{
public:
MyClass() {};
~MyClass() {};
void MyFunction(const T &);
};
template<class T>
void MyClass<T>::MyFunction(const T &value)
{
// do something
}My second question is if I have to keep the implementation of my functions in the same file, would there be a point to still define it outside if the class definition like I have shown above, or should I just define it inside the class? Thanks.
__________________
I am Addicted to Linux! |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| friends, templates, and other s**t | bl00dninja | C++ | 4 | Oct 14th, 2006 1:15 AM |
| Help: Template Class' copy constructor | MicahCarrick | C++ | 2 | Jan 23rd, 2006 5:33 AM |
| Function Template Question | aznluvsmc | C++ | 6 | Oct 7th, 2005 11:37 PM |
| Template + operator problem | Polyphemus_ | C++ | 3 | Sep 30th, 2005 6:43 PM |
| nontype default template parameters | earl | C++ | 4 | Jun 21st, 2005 11:27 AM |