This repository has been archived on 2024-03-07. You can view files and clone it, but cannot push or open issues/pull-requests.
wongola/lib/commons.hpp

30 lines
823 B
C++
Raw Permalink Normal View History

#ifndef wg_COMMONS_HPP
#define wg_COMMONS_HPP
#define WG_GEN_ENUM(X) X
#define WG_GEN_STRING(X) #X
#define WG_ENUM(PREFIX, TYPES) \
enum PREFIX { TYPES(WG_GEN_ENUM) }; \
constexpr char const* PREFIX ## Str [] = { TYPES(WG_GEN_STRING) }
#define WG_ERROR(NAME) \
struct NAME : public std::runtime_error { \
NAME (std::string const& what) : std::runtime_error { what } {} \
}
#define WG_ASSERT(COND, MSG) \
if ( ! (COND) ) { std::cerr << MSG << std::endl; abort(); }
#include <string>
#include <filesystem>
#include <memory>
#include <vector>
#include <sstream>
#include <iostream>
#include <cstring>
#include <functional>
#include <optional>
#endif