mirror of
https://github.com/polybar/polybar.git
synced 2024-10-27 05:23:39 -04:00
17 lines
319 B
C++
17 lines
319 B
C++
#pragma once
|
|
|
|
#include <unistd.h>
|
|
|
|
#include "common.hpp"
|
|
|
|
POLYBAR_NS
|
|
|
|
namespace factory_util {
|
|
template <class T, class... Deps>
|
|
shared_ptr<T> singleton(Deps&&... deps) {
|
|
static shared_ptr<T> instance{make_shared<T>(forward<Deps>(deps)...)};
|
|
return instance;
|
|
}
|
|
} // namespace factory_util
|
|
|
|
POLYBAR_NS_END
|