-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOboroShiki.cpp
52 lines (26 loc) · 949 Bytes
/
OboroShiki.cpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "./Cast.h"
#include "./OboroShiki.h"
struct OboroShikiImpl {
~OboroShikiImpl() noexcept;
OboroShikiImpl();
void Call() const;
};
OboroShikiImpl* Cast(const OboroShiki* p) { return to_ptr<OboroShikiImpl>(p); }
OboroShiki* Cast(const OboroShikiImpl* p) { return to_ptr<OboroShiki>(p); }
//
OboroShikiImpl::~OboroShikiImpl() noexcept
{
}
OboroShikiImpl::OboroShikiImpl()
{
}
void OboroShikiImpl::Call() const
{
}
//
OboroShiki::~OboroShiki() noexcept { Cast(this)->~OboroShikiImpl(); }
std::unique_ptr<OboroShiki> OboroShiki::MakeUnique() { return std::unique_ptr<OboroShiki>(Cast(new OboroShikiImpl())); }
void OboroShiki::Call() const { return Cast(this)->Call(); }
// local_ptr
std::size_t OboroShiki::local_size() { return sizeof(OboroShikiImpl); }
void OboroShiki::local_init() { new(this) OboroShikiImpl(); }