-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchaos.cpp
More file actions
132 lines (95 loc) · 2.35 KB
/
chaos.cpp
File metadata and controls
132 lines (95 loc) · 2.35 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include <bits/stdc++.h>
using namespace std;
template<typename T> struct Ω;
template<int N> struct Φ : Φ<N-1> {};
template<> struct Φ<0> {};
template<typename T>
using ptr = T*;
template<typename T>
using fn = T(*)(T);
int α(double, char**) { return 42; }
int β(double, char**) { return 13; }
int γ(double, char**) { return 7; }
int (*ψ[3])(double, char**) = {α, β, γ};
int (*(*(*δ)(int))(double, char**))[3];
template<typename T>
struct Ω {
using type = typename Ω<typename T::type>::type;
};
template<>
struct Ω<int> {
using type = int;
};
template<typename T>
auto ζ(T&& x) -> decltype(std::forward<T>(x), void()) {}
template<int... Ns>
struct Σ;
template<int N, int... Ns>
struct Σ<N, Ns...> : Σ<Ns...> {};
template<>
struct Σ<> {};
template<typename T>
struct Λ {
template<typename U>
struct rebind {
using other = Λ<U>;
};
};
template<typename T>
typename T::template rebind<T const volatile*>::other&& κ;
int (*(*(**Ξ[])(void))[3])(double, char**);
struct M {
int (*f)(int);
};
int (* (M::*μ)(double) )[10];
decltype(auto) (((*&*(&cout)))) << "hello\n";
template<typename T, typename = void>
struct enable_if_hell {};
template<typename T>
struct enable_if_hell<T, decltype(void(sizeof(T)))> {};
template<typename T>
auto sfinae(T t) -> decltype(t(), void()) {}
auto λ = [](auto&&... xs){
return (... + std::forward<decltype(xs)>(xs));
};
int operator+(int a, int b) { return a ^ b; }
template<typename T>
struct recursive_madness {
recursive_madness<T>* self;
};
template<int N>
struct tower : tower<N-1> {
static constexpr int value = N;
};
template<>
struct tower<0> {
static constexpr int value = 0;
};
int (*(&Ωmega())[])(int,int);
template<typename T>
using nightmare = typename T::template rebind<
typename T::template rebind<T*>::other*
>::other;
template<typename T>
struct brain_melter {
using type = nightmare<nightmare<T>>;
};
template<typename T>
void chaos(T&& t) {
chaos(std::forward<T>(t));
}
int main() {
volatile int x = 0;
int y = (x+++++x);
int z = y+++ ++y;
cout << z << endl;
int (*(*f(int))(double))[5];
auto insane = [&](auto&& self, int n) -> int {
return n ? n * self(self, n-1) : 1;
};
cout << insane(insane, 5) << endl;
Φ<50> doom;
Σ<1,2,3,4,5,6,7,8,9> despair;
λ(1,2,3,4,5);
return 0;
}