Support Class Library
A set of tools providing classes and utility
aliases.h
Go to the documentation of this file.
1 #pragma once
2 #include <unordered_map>
3 #include <unordered_set>
4 #include <set>
5 #include <map>
6 #include <chrono>
7 
8 namespace scl{
9  namespace alias{
10  // Containers
16  template <class Key, class Value, class... Ts>
17  using Map = std::unordered_map<Key, Value, Ts...>;
18 
24  template <class Key, class Value, class... Ts>
25  using SortedMap = std::map<Key, Value, Ts...>;
26 
31  template <class Value, class... Ts>
32  using Set = std::unordered_set<Value, Ts...>;
33 
38  template <class Value, class... Ts>
39  using SortedSet = std::set<Value, Ts...>;
40 
41  // Numbers
45  using uchar = unsigned char;
46 
50  using ushort = unsigned short;
51 
55  using uint = unsigned int;
56 
60  using ulong = unsigned long;
61 
65  using ullong = unsigned long long;
66 
70  using usize = std::size_t;
71 
75  using u8 = uint8_t;
76 
80  using u16 = uint16_t;
81 
85  using u32 = uint32_t;
86 
90  using u64 = uint64_t;
91 
95  using i8 = int8_t;
96 
100  using i16 = int16_t;
101 
105  using i32 = int32_t;
106 
110  using i64 = int64_t;
111 
115  using c16 = char16_t;
116 
120  using c32 = char32_t;
121 
125  using ldouble = long double;
126 
131 
136 
142 
148 
153 
158 
159 #ifdef SCL_CPP20
160 
163  using days = std::chrono::days;
164 
168  using weeks = std::chrono::weeks;
169 
173  using months = std::chrono::months;
174 
178  using years = std::chrono::years;
179 #endif
180  }
181 }
std::unordered_set< Value, Ts... > Set
A set of unique values.
Definition: aliases.h:32
int16_t i16
16-bit integer
Definition: aliases.h:100
int32_t i32
32-bit integer
Definition: aliases.h:105
unsigned long ulong
Unsigned long integer.
Definition: aliases.h:60
unsigned char uchar
Unsigned character type.
Definition: aliases.h:45
Global namespace of the SCL.
Definition: alias.hpp:3
unsigned long long ullong
Unsigned long long integer.
Definition: aliases.h:65
std::unordered_map< Key, Value, Ts... > Map
A collection of key-value pairs.
Definition: aliases.h:17
unsigned short ushort
Unsigned short integer.
Definition: aliases.h:50
std::set< Value, Ts... > SortedSet
A sorted set of unique values.
Definition: aliases.h:39
std::size_t usize
Unsigned size type.
Definition: aliases.h:70
uint32_t u32
32-bit unsigned integer
Definition: aliases.h:85
int64_t i64
64-bit integer
Definition: aliases.h:110
std::chrono::nanoseconds nanoseconds
Duration in nanoseconds.
Definition: aliases.h:130
std::map< Key, Value, Ts... > SortedMap
A sorted collection of key-value pairs.
Definition: aliases.h:25
std::chrono::hours hours
Duration in hours.
Definition: aliases.h:157
std::chrono::microseconds microseconds
Duration in microseconds.
Definition: aliases.h:135
char16_t c16
16-bit character
Definition: aliases.h:115
uint16_t u16
16-bit unsigned integer
Definition: aliases.h:80
std::chrono::milliseconds milliseconds
Duration in milliseconds.
Definition: aliases.h:141
details::map_toolbox< T, U > map(F &&mapper)
Map a stream.
Definition: map.h:97
int8_t i8
8-bit integer
Definition: aliases.h:95
long double ldouble
Long double.
Definition: aliases.h:125
std::chrono::minutes minutes
Duration in minutes.
Definition: aliases.h:152
unsigned int uint
Unsigned integer.
Definition: aliases.h:55
std::chrono::seconds seconds
Duration in seconds.
Definition: aliases.h:147
uint8_t u8
8-bit unsigned integer
Definition: aliases.h:75
char32_t c32
32-bit character
Definition: aliases.h:120
uint64_t u64
64-bit unsigned integer
Definition: aliases.h:90