4 ms·
You can use user-defined literals for a portable way to write four-character codes: constexpr std::uint32_t operator "" _4CC(const char* str, size_t len) {
by DerekL 9y ago
You can use user-defined literals for a portable way to write four-character codes:
constexpr std::uint32_t operator "" _4CC(const char* str, size_t len) {
std::uint32_t result = 0;
for (size_t i = 0; i < len; ++i) {
result = (result << 8) + (std::uint32_t)(unsigned char)(str[i]);
}
return result;
}
auto const movie = "MooV"_4CC;