Utility Rack
Loading...
Searching...
No Matches
byte_array.hpp
Go to the documentation of this file.
1
35#ifndef MAKE_BYTE_ARRAY_HPP_INCLUDED
36#define MAKE_BYTE_ARRAY_HPP_INCLUDED
37
38#include <array>
39#include <cstddef> // std::byte
40#include <utility> // std::forward
41
42namespace chops {
43
44template<typename... Ts>
45constexpr std::array<std::byte, sizeof...(Ts)> make_byte_array(Ts&&... args) noexcept {
46 return { std::byte{static_cast<std::byte>(std::forward<Ts>(args))}... };
47}
48
49template <typename std::size_t N>
50constexpr bool compare_byte_arrays (const std::array<std::byte, N>& lhs, const std::array<std::byte, N>& rhs) {
51 return lhs == rhs;
52}
53
54} // end namespace
55
56#endif
57