2016-11-20 23:04:31 +01:00
|
|
|
#pragma once
|
|
|
|
|
2016-12-03 16:44:08 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2016-11-20 23:04:31 +01:00
|
|
|
#include "common.hpp"
|
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
namespace factory_util {
|
2016-12-05 20:41:00 +01:00
|
|
|
template <class T, class... Deps>
|
|
|
|
shared_ptr<T> singleton(Deps&&... deps) {
|
2016-12-13 14:26:09 +01:00
|
|
|
static shared_ptr<T> instance{make_shared<T>(forward<Deps>(deps)...)};
|
2016-11-20 23:04:31 +01:00
|
|
|
return instance;
|
|
|
|
}
|
2022-03-06 17:44:48 +01:00
|
|
|
} // namespace factory_util
|
2016-11-20 23:04:31 +01:00
|
|
|
|
|
|
|
POLYBAR_NS_END
|