Hi
I came accross a code and i din't understand it
Template.h
#define FRIEND_NEW template<class T> friend inline T* ::safe_new(const char*,int);
template<typename T> inline T* safe_new0(const char* file, int line)
{
T* ptr = new T();
return ptr;
};
A.h
#include "Template.h"
class A
{
FRIEND_NEW
protected:
A();
};
What is this template code?
As I went thorough the multiple classes of the project I got to know that this guy trying to keep protected constructors and create instances in the fiend classes.
But this template structure I am not clear.
Can you please explain?