chore(cpp): introduce aliases

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-08-12 23:16:08 +02:00
parent e39ed7a5c0
commit c8035c22dc
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -22,6 +22,31 @@
#pragma region helpers
#pragma region aliases
#define LOOP(var, n) for (auto var = 0; var < n; ++var)
template <typename T>
using V = std::vector<T>;
template <typename K, typename V>
using M = std::map<K, V>;
template <typename T>
using S = std::set<T>;
template <typename T>
using Q = std::deque<T>;
using i8 = std::int8_t;
using u8 = std::uint8_t;
using i16 = std::int16_t;
using u16 = std::uint16_t;
using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
#pragma endregion /* aliases */
#pragma region debug
void dbg_out() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
@ -113,8 +138,6 @@ inline void no() { std::cout << "NO\n"; }
inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; }
#pragma endregion /* output */
#define LOOP(var, n) for (auto var = 0; var < n; ++var)
#pragma endregion /* helpers */
// for N test cases, uncomment for single test case