forked from snakster/cpp.react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSingleton.h
More file actions
32 lines (25 loc) · 959 Bytes
/
Singleton.h
File metadata and controls
32 lines (25 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Sebastian Jeckel 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include "react/detail/Defs.h"
/***************************************/ REACT_IMPL_BEGIN /**************************************/
///////////////////////////////////////////////////////////////////////////////////////////////////
/// BasicSingleton
///////////////////////////////////////////////////////////////////////////////////////////////////
template <typename T>
class BasicSingleton
{
public:
static T& Instance()
{
static T instance;
return instance;
}
protected:
BasicSingleton() {}
BasicSingleton(const BasicSingleton& other) {}
BasicSingleton(BasicSingleton&& other) {}
};
/****************************************/ REACT_IMPL_END /***************************************/