28 lines
731 B
C++
28 lines
731 B
C++
|
#ifndef maze_COMMON_HPP
|
||
|
#define maze_COMMON_HPP
|
||
|
|
||
|
#include <memory>
|
||
|
#include <iostream>
|
||
|
#include <vector>
|
||
|
#include <unordered_map>
|
||
|
#include <string>
|
||
|
#include <fstream>
|
||
|
#include <sstream>
|
||
|
#include <functional>
|
||
|
#include <optional>
|
||
|
#include <any>
|
||
|
|
||
|
#define MAZE_GEN_ENUM(X) X
|
||
|
#define MAZE_GEN_STRING(X) #X
|
||
|
|
||
|
#define MAZE_ENUM(PREFIX, KINDS) \
|
||
|
enum PREFIX { KINDS(MAZE_GEN_ENUM) }; \
|
||
|
constexpr char const* PREFIX ## Str [] = { KINDS(MAZE_GEN_STRING) }
|
||
|
|
||
|
#define MAZE_ERROR(ERR) \
|
||
|
struct ERR : public std::runtime_error { \
|
||
|
ERR (std::string const& what): std::runtime_error(what) {} \
|
||
|
}
|
||
|
|
||
|
#endif
|