Parts of std::vector implementation from https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/api/a01699.html
struct __array_traits | |
{ | |
typedef _Tp _Type[_Nm]; //(1) | |
typedef __is_swappable<_Tp> _Is_swappable; | |
typedef __is_nothrow_swappable<_Tp> _Is_nothrow_swappable; | |
static constexpr _Tp& | |
_S_ref(const _Type& __t, std::size_t __n) noexcept | |
{ return const_cast<_Tp&>(__t[__n]); } | |
static constexpr _Tp* | |
_S_ptr(const _Type& __t) noexcept | |
{ return const_cast<_Tp*>(__t); } | |
}; | |
_GLIBCXX17_CONSTEXPR reference | |
operator[](size_type __n) noexcept | |
{ return _AT_Type::_S_ref(_M_elems, __n); } //(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment