diff --git a/src/openvic-simulation/types/TypedSpan.hpp b/src/openvic-simulation/types/TypedSpan.hpp index 5e58fbda..6c01cc07 100644 --- a/src/openvic-simulation/types/TypedSpan.hpp +++ b/src/openvic-simulation/types/TypedSpan.hpp @@ -9,7 +9,7 @@ namespace OpenVic { template< - derived_from_specialization_of IndexType, + is_strongly_typed IndexType, typename ValueType, size_t _Extent = std::dynamic_extent > @@ -17,16 +17,16 @@ namespace OpenVic { public: using forwardable_span::forwardable_span; - constexpr IndexType size() const { + [[nodiscard]] constexpr IndexType size() const { return IndexType(forwardable_span::size()); } - constexpr forwardable_span::reference operator[](const IndexType _Off) const { - assert(_Off < size()); - return forwardable_span::operator[](static_cast(type_safe::get(_Off))); + [[nodiscard]] constexpr forwardable_span::reference operator[](const IndexType index) const { + assert(index < size()); + return forwardable_span::operator[](static_cast(type_safe::get(index))); } - constexpr operator TypedSpan() { + [[nodiscard]] constexpr operator TypedSpan() const { return TypedSpan{*this}; } };