EightBit/M6502/HarteTest_6502/byte_t.h
Adrian Conlon b70f24a581 Draw an end to my json experimentations. simdjson is king. long live simdjson!
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-10-20 21:44:43 +01:00

18 lines
408 B
C++

#pragma once
#include <cstdint>
#include "simdjson/simdjson.h"
class byte_t final {
private:
simdjson::dom::array m_raw;
public:
byte_t(simdjson::dom::element input) noexcept;
byte_t(simdjson::dom::array input) noexcept;
[[nodiscard]] auto address() const noexcept { return (uint16_t)(int64_t)*m_raw.begin(); }
[[nodiscard]] auto value() const noexcept { return (uint8_t)(int64_t)m_raw.at(1); }
};