Skip to content

Commit

Permalink
[libcxx][span] Remove tuple interface
Browse files Browse the repository at this point in the history
This implements P2116 by removing the tuple interface from std::span.

Differential Revision: https://reviews.llvm.org/D75640
  • Loading branch information
miscco authored and ldionne committed May 14, 2020
1 parent 80715b7 commit c73a491
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 279 deletions.
28 changes: 0 additions & 28 deletions libcxx/include/span
Expand Up @@ -539,34 +539,6 @@ private:
size_type __size;
};

// tuple interface
template <class _Tp, size_t _Size>
struct _LIBCPP_TEMPLATE_VIS tuple_size<span<_Tp, _Size>>
: public integral_constant<size_t, _Size> {};

template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_size<span<_Tp, dynamic_extent>>; // declared but not defined


template <size_t _Ip, class _Tp, size_t _Size>
struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, span<_Tp, _Size>>
{
static_assert( dynamic_extent != _Size, "std::tuple_element<> not supported for std::span<T, dynamic_extent>");
static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::span)");
typedef _Tp type;
};

template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY constexpr
_Tp&
get(span<_Tp, _Size> __s) noexcept
{
static_assert( dynamic_extent != _Size, "std::get<> not supported for std::span<T, dynamic_extent>");
static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::span)");
return __s[_Ip];
}


// as_bytes & as_writable_bytes
template <class _Tp, size_t _Extent>
_LIBCPP_INLINE_VISIBILITY
Expand Down
29 changes: 0 additions & 29 deletions libcxx/test/std/containers/views/span.tuple/get.fail.cpp

This file was deleted.

75 changes: 0 additions & 75 deletions libcxx/test/std/containers/views/span.tuple/get.pass.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp

This file was deleted.

52 changes: 0 additions & 52 deletions libcxx/test/std/containers/views/span.tuple/tuple_element.pass.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions libcxx/test/std/containers/views/span.tuple/tuple_size.fail.cpp

This file was deleted.

46 changes: 0 additions & 46 deletions libcxx/test/std/containers/views/span.tuple/tuple_size.pass.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion libcxx/www/cxx2a_status.html
Expand Up @@ -253,7 +253,7 @@ <h3>Paper Status</h3>
<tr><td><a href="https://wg21.link/P2101">P2101</a></td><td>LWG</td><td>'Models' subsumes 'satisfies' (Wording for US298 and US300)</td><td>Prague</td><td><i> </i></td><td></td></tr>
<tr><td><a href="https://wg21.link/P2102">P2102</a></td><td>LWG</td><td>Make 'implicit expression variations' more explicit (Wording for US185)</td><td>Prague</td><td><i> </i></td><td></td></tr>
<tr><td><a href="https://wg21.link/P2106">P2106</a></td><td>LWG</td><td>Alternative wording for GB315 and GB316</td><td>Prague</td><td><i> </i></td><td></td></tr>
<tr><td><a href="https://wg21.link/P2116">P2116</a></td><td>LWG</td><td>Remove tuple-like protocol support from fixed-extent span</td><td>Prague</td><td><i> </i></td><td></td></tr>
<tr><td><a href="https://wg21.link/P2116">P2116</a></td><td>LWG</td><td>Remove tuple-like protocol support from fixed-extent span</td><td>Prague</td><td>Complete</td><td>11.0</td></tr>
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>

Expand Down

0 comments on commit c73a491

Please sign in to comment.