refactor: continue refactor project from C++17 to 23

This commit is contained in:
2025-07-25 10:49:07 +08:00
parent 4f0b3d19d1
commit b79df0c65e
22 changed files with 296 additions and 498 deletions

View File

@ -5,3 +5,24 @@
#error "Current system endian (byte order) is not supported!"
#endif
namespace yycc::macro::endian {
/// @brief The endian kind of OS.
enum class EndianKind {
Little, ///< Little endian.
Big, ///< Big endian.
};
/**
* @brief Fetch the endian of OS.
* @return The endian of OS.
*/
inline constexpr EndianKind get_endian() {
#if defined(YYCC_ENDIAN_LITTLE)
return EndianKind::Little;
#else
return EndianKind::Big;
#endif
}
} // namespace yycc::macro::endian