Skip to content

Instantly share code, notes, and snippets.

@Ben1980
Last active November 11, 2019 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben1980/5157039b689dee84685a626539a9625b to your computer and use it in GitHub Desktop.
Save Ben1980/5157039b689dee84685a626539a9625b to your computer and use it in GitHub Desktop.
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