Hi,
how do I the second parameter become optional?
template <typename T>
inline void Delete (T *&MemoryToFree,
T *&MemoryToFree2 = ){
delete MemoryToFree;
MemoryToFree = NULL;
delete MemoryToFree2;
MemoryToFree2 = NULL;
}
I tried several things after the = operator, like NULL, (T*)NULL etc can this be done?
the only way the compiler let me do it was this: using overload...
template <typename T, typename T2>
inline void Delete (T *&MemoryToFree, T2 *&MemoryToFree2){
delete MemoryToFree;
MemoryToFree = NULL;
delete MemoryToFree2;
MemoryToFree2 = NULL;
}
just to learn...