Cytopia
0.3
A city building simulation game
Singleton.hxx
Go to the documentation of this file.
1
#ifndef SINGLETON_HXX_
2
#define SINGLETON_HXX_
3
8
template
<
typename
T>
class
Singleton
9
{
10
11
public
:
15
static
T &
instance
(
void
)
16
{
17
static
T singleton;
18
return
singleton;
19
}
20
21
protected
:
22
Singleton
() noexcept = default;
23
~
Singleton
() noexcept = default;
24
};
25
26
#endif
Singleton
Abstract Singleton implementation.
Definition:
Singleton.hxx:8
Singleton::Singleton
Singleton() noexcept=default
Singleton::instance
static T & instance(void)
Get an instance of the singleton.
Definition:
Singleton.hxx:15
src
util
Singleton.hxx
Generated on Sun Nov 27 2022 09:50:52 for Cytopia by
1.8.17