refs #320 Move own implementation of std::make_unique into BlackMisc

This commit is contained in:
Roland Winklmeier
2014-12-25 17:33:34 +01:00
parent 13a05f729e
commit c0265ba0e4
3 changed files with 12 additions and 9 deletions

View File

@@ -17,6 +17,8 @@
#include <QVariant>
#include <QDBusArgument>
#include <memory>
/*!
* Workaround, to call initResource from namespace. Used in BlackMisc::initResources().
* Q_INIT_RESOURCE adds resource, here the translation files.
@@ -162,6 +164,13 @@ namespace BlackMisc
//! Get local host name env.variable
const QString &localHostNameEnvVariable();
//! Own implementation of std::make_unique, a C++14 feature not provided by GCC in C++11 mode
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
} // BlackMisc
#endif // guard