-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.hpp
85 lines (69 loc) · 1.39 KB
/
types.hpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// Created by jmeny on 21.10.19.
//
#include <array>
#pragma once
using A = std::array<int, 9>;
struct B {
B() = default;
virtual void execute() const = 0;
virtual ~B() = default;
};
struct X1: B
{
explicit X1(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[0];}
};
struct X2: B
{
explicit X2(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[1];}
};
struct X3: B
{
explicit X3(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[2];}
};
struct X4: B
{
explicit X4(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[3];}
};
struct X5: B
{
explicit X5(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[4];}
};
struct X6: B
{
explicit X6(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[5];}
};
struct X7: B
{
explicit X7(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[6];}
};
struct X8: B
{
explicit X8(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[7];}
};
struct X9: B
{
explicit X9(A& a) : arr(std::addressof(a)) {}
A* arr;
void execute() const override {++(*arr)[8];}
};
struct mono
{
void execute() const{};
};