Last active
November 11, 2019 12:02
-
-
Save Ben1980/5157039b689dee84685a626539a9625b to your computer and use it in GitHub Desktop.
Parts of std::vector implementation from https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/api/a01699.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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