// // Created by stepus53 on 24.8.24. // #ifndef STUFF_H #define STUFF_H #include #include "Exception.h" #ifdef __APPLE__ #include #define htobe64(x) htonll(x) #define be64toh(x) ntohll(x) #else #include #endif #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wsign-compare" template constexpr To checked_cast(const From& f) { To result = static_cast(f); if (f != result) { throw Exception("Value out of bounds"); } return result; } #pragma GCC diagnostic pop std::vector split(const std::string& s, char delim); #endif // STUFF_H