NasNas
An intuitive and beginner friendly 2D game framework for C++
include
NasNas
core
data
Singleton.hpp
1
// Created by Modar Nasser on 04/08/2021.
2
3
#pragma once
4
5
namespace
ns::detail
{
6
template
<
class
T>
7
class
Singleton
{
8
protected
:
9
Singleton
() =
default
;
10
public
:
11
Singleton
(
const
Singleton
&) =
delete
;
12
Singleton
(
Singleton
&&) =
delete
;
13
Singleton
& operator=(
const
Singleton
&) =
delete
;
14
Singleton
& operator=(
Singleton
&&) =
delete
;
15
16
static
auto
get
() -> T&;
17
};
18
19
template
<
class
T>
20
auto
Singleton<T>::get
() -> T& {
21
static
T instance;
22
return
instance;
23
}
24
}
ns::detail
Definition:
AppAccess.hpp:13
ns::detail::Singleton
Definition:
Singleton.hpp:7
Generated by
1.8.13