musique/lib/link/include/ableton/mbliterals.hpp
2023-01-14 22:52:45 +01:00

18 lines
335 B
C++

#pragma once
#include <cstdint>
#include <iterator>
#include <numeric>
#include <concepts>
namespace ableton
{
consteval std::int32_t bytes(std::convertible_to<char const*> auto const &array)
{
return std::accumulate(array, array + std::size(array) - 1, std::int32_t(0), [](auto p, auto c)
{
return (p << 8) | c;
});
}
}