myproject 0.0.0
%%description%%
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <utility>
5
6namespace myproject {
7
8template <typename T>
9using Scope = std::unique_ptr<T>;
10template <typename T, typename... Args>
11constexpr Scope<T> CreateScope(Args&&... args) {
12 return std::make_unique<T>(std::forward<Args>(args)...);
13}
14
15template <typename T>
16using Ref = std::shared_ptr<T>;
17template <typename T, typename... Args>
18constexpr Ref<T> CreateRef(Args&&... args) {
19 return std::make_shared<T>(std::forward<Args>(args)...);
20}
21
22} // namespace myproject
Definition application.cpp:63
std::shared_ptr< T > Ref
Definition base.h:16
constexpr Ref< T > CreateRef(Args &&... args)
Definition base.h:18
constexpr Scope< T > CreateScope(Args &&... args)
Definition base.h:11
std::unique_ptr< T > Scope
Definition base.h:9