diff --git a/src/lib/utils/strong_type.h b/src/lib/utils/strong_type.h index dda41492da6..a1fb4544115 100644 --- a/src/lib/utils/strong_type.h +++ b/src/lib/utils/strong_type.h @@ -137,6 +137,12 @@ class Strong_Adapter : public Strong_Base { { this->get().resize(size); } + + decltype(auto) operator[](size_type i) const noexcept(noexcept(this->get().operator[](i))) { + return this->get()[i]; + } + + decltype(auto) operator[](size_type i) noexcept(noexcept(this->get().operator[](i))) { return this->get()[i]; } }; } // namespace detail @@ -572,6 +578,8 @@ class StrongSpan { decltype(auto) end() const noexcept(noexcept(this->m_span.end())) { return this->m_span.end(); } + decltype(auto) operator[](typename underlying_span::size_type i) const noexcept { return this->m_span[i]; } + private: underlying_span m_span; };