-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbasebase.hpp
More file actions
153 lines (118 loc) · 4.12 KB
/
Copy pathbasebase.hpp
File metadata and controls
153 lines (118 loc) · 4.12 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
------------------------------------------------------------
* basic types, macros, compiler-settings, etc...
------------------------------------------------------------
*
* This program may be freely redistributed under the
* condition that the copyright notices (including this
* entire header) are not removed, and no compensation
* is received through use of the software. Private,
* research, and institutional use is free. You may
* distribute modified versions of this code UNDER THE
* CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE
* TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE
* ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE
* MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR
* NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution
* of this code as part of a commercial system is
* permissible ONLY BY DIRECT ARRANGEMENT WITH THE
* AUTHOR. (If you are not directly supplying this
* code to a customer, and you are instead telling them
* how they can obtain it for free, then you are not
* required to make any arrangement with me.)
*
* Disclaimer: Neither I nor: Columbia University, The
* Massachusetts Institute of Technology, The
* University of Sydney, nor The National Aeronautics
* and Space Administration warrant this code in any
* way whatsoever. This code is provided "as-is" to be
* used at your own risk.
*
------------------------------------------------------------
*
* Last updated: 11 May., 2024
*
* Copyright 2020--
* Darren Engwirda
* d.engwirda@gmail.com
* https://github.com/dengwirda/
*
------------------------------------------------------------
*/
# pragma once
# ifndef __BASEBASE__
# define __BASEBASE__
# include <utility>
# include <cstddef>
# include <cassert>
/*
------------------------------------------------------------
* push compiler settings
------------------------------------------------------------
*/
# if defined(_MSC_VER)
# pragma warning(disable:4127) // constant conditionals
# pragma warning(disable:4503) // decorated name length
# elif defined(__LLVM__)
# elif defined(__GNUC__)
# endif
# define __assert assert
/*
------------------------------------------------------------
* global data type alias
------------------------------------------------------------
*/
typedef void void_type ;
typedef bool bool_type ;
typedef char char_type ;
/*
------------------------------------------------------------
* function call decorator
------------------------------------------------------------
*/
# define __inline_call inline
# define __normal_call
# define __static_call static
# define __friend_call friend
# define __nocast_call explicit
/*
------------------------------------------------------------
* copy // move forwarding
------------------------------------------------------------
*/
# define __copy(T, x) std::forward<T const&>(x)
# define __move(T, x) std::forward<T &&>(x)
/*
------------------------------------------------------------
* unused parameter macros
------------------------------------------------------------
*/
# define __unreferenced(x) ((void) x)
/*
------------------------------------------------------------
* no--alias pointer types
------------------------------------------------------------
*/
# define __const_ptr(T) T const *__restrict
# define __write_ptr(T) T *__restrict
# define __const_ref(T) T const &__restrict
# define __write_ref(T) T &__restrict
/*
------------------------------------------------------------
* integer "flip" routines
------------------------------------------------------------
*/
# define __isflip(__i) ( (__i) < 0)
# define __doflip(__i) (-(__i) - 2)
# define __unflip(__i) (((__i) < 0) \
? __doflip(__i) : (__i) )
/*
------------------------------------------------------------
* integer "flip" routines
------------------------------------------------------------
*/
# define __setbit(x,b) ((x)|= (1ULL<<(b)))
# define __popbit(x,b) ((x)&= ~(1ULL<<(b)))
# define __flpbit(x,b) ((x)^= (1ULL<<(b)))
# define __chkbit(x,b) (!!((x)&(1ULL<<(b))) )
# endif//__BASEBASE__