File: factory.hpp

package info (click to toggle)
polybar 3.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,108 kB
  • sloc: cpp: 30,424; python: 3,750; sh: 284; makefile: 83
file content (17 lines) | stat: -rw-r--r-- 319 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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