Skip to content

LWG-3797 elements_view insufficiently constrained #6204

Description

LWG-3797 elements_view insufficiently constrained

I'm not immediately sure whether both versions of our _Has_tuple_element conforms to this LWG issue's resolution:

STL/stl/inc/ranges

Lines 4705 to 4716 in da06be8

template <class _Tuple, size_t _Index>
concept _Has_tuple_element =
#if _HAS_CXX23
_Tuple_like<_Tuple> && _Index < tuple_size_v<_Tuple>;
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
requires(_Tuple __t) {
typename tuple_size<_Tuple>::type;
requires _Index < tuple_size_v<_Tuple>;
typename tuple_element_t<_Index, _Tuple>;
{ _STD get<_Index>(__t) } -> convertible_to<const tuple_element_t<_Index, _Tuple>&>;
};
#endif // ^^^ !_HAS_CXX23 ^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWGLibrary Working Group issuefixedSomething works now, yay!rangesC++20/23 ranges

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions