icinga2/base/cxx11-compat.h

23 lines
452 B
C
Raw Normal View History

2012-04-03 15:47:32 +02:00
#ifndef CXX11COMPAT_H
#define CXX11COMPAT_H
template <typename T>
shared_ptr<T> make_shared(void)
{
return shared_ptr<T>(new T());
}
template <typename T, typename TArg1>
shared_ptr<T> make_shared(const TArg1& arg1)
{
2012-04-04 10:21:14 +02:00
return shared_ptr<T>(new T(arg1));
2012-04-03 15:47:32 +02:00
}
template <typename T, typename TArg1, typename TArg2>
shared_ptr<T> make_shared(const TArg1& arg1, const TArg2& arg2)
{
2012-04-04 10:21:14 +02:00
return shared_ptr<T>(new T(arg1, arg2));
2012-04-03 15:47:32 +02:00
}
#endif /* CXX11COMPAT_H */