Files
MIRROR-LX-OriginalRepo/common/Util.h
2025-04-16 19:32:26 +01:00

19 lines
462 B
C++

#pragma once
#include <fstream>
namespace LX
{
template<typename T, typename... Args>
inline void ThrowIf(const bool condition, Args... args)
{ if (condition) [[unlikely]] { throw T(args...); }}
template<typename... Args>
inline void SafeLog(std::ofstream* log, Args... args)
{
if (log != nullptr) { (*log << ... << args); *log << "\n"; }
}
constexpr const char* LOG_BREAK = "\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
}