From 850159dc9663a1cb0a7bb8f25fe1d426134ccabb Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Fri, 2 May 2025 16:17:56 +0200 Subject: implement file viewer --- lib/nes/common/containers/span.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/nes/common/containers') diff --git a/lib/nes/common/containers/span.hh b/lib/nes/common/containers/span.hh index 324d486..ec48622 100644 --- a/lib/nes/common/containers/span.hh +++ b/lib/nes/common/containers/span.hh @@ -85,6 +85,12 @@ namespace nes return span{ data_ + first, OtherLength, {} }; } + template + auto unsafe_bitcast() const -> span + { + return span{ reinterpret_cast(data_), static_cast(length_ / sizeof(U)) }; + } + auto operator[](u32 const index) const -> T& { NES_ASSERT(index < get_length() && "index out of bounds"); @@ -98,4 +104,4 @@ namespace nes { } }; -} // namespace nes \ No newline at end of file +} // namespace nes -- cgit v1.3.1