Files

26 lines
392 B
C++

//
// Created by David Hackbarth on 27.02.26.
//
#ifndef MISC_TEMPLATES_H
#define MISC_TEMPLATES_H
template<class T>
void safeDelete(T*& pObj)
{
if (pObj != nullptr)
{
delete pObj;
pObj = nullptr;
}
}
template<class T>
class Node {
public:
T data;
Node* next;
Node(T data) : data(data), next(nullptr) {}
};
#endif //MISC_TEMPLATES_H