requires is_array_v<remove_reference_t<_Tp>> || __member_begin<_Tp>
|| __adl_begin<_Tp>
constexpr auto
- operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
{
if constexpr (is_array_v<remove_reference_t<_Tp>>)
{
requires is_bounded_array_v<remove_reference_t<_Tp>>
|| __member_end<_Tp> || __adl_end<_Tp>
constexpr auto
- operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
{
if constexpr (is_bounded_array_v<remove_reference_t<_Tp>>)
{
template<__maybe_borrowed_range _Tp>
requires __member_rbegin<_Tp> || __adl_rbegin<_Tp> || __reversable<_Tp>
constexpr auto
- operator()(_Tp&& __t) const
+ operator()[[nodiscard]](_Tp&& __t) const
noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
{
if constexpr (__member_rbegin<_Tp>)
return __t.rbegin();
template<__maybe_borrowed_range _Tp>
requires __member_rend<_Tp> || __adl_rend<_Tp> || __reversable<_Tp>
constexpr auto
- operator()(_Tp&& __t) const
+ operator()[[nodiscard]](_Tp&& __t) const
noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
{
if constexpr (__member_rend<_Tp>)
return __t.rend();
requires is_bounded_array_v<remove_reference_t<_Tp>>
|| __member_size<_Tp> || __adl_size<_Tp> || __sentinel_size<_Tp>
constexpr auto
- operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
{
if constexpr (is_bounded_array_v<remove_reference_t<_Tp>>)
return extent_v<remove_reference_t<_Tp>>;
template<typename _Tp>
requires requires (_Tp& __t) { _Size{}(__t); }
constexpr auto
- operator()(_Tp&& __t) const noexcept(noexcept(_Size{}(__t)))
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(noexcept(_Size{}(__t)))
{
auto __size = _Size{}(__t);
using __size_type = decltype(__size);
requires __member_empty<_Tp> || __size0_empty<_Tp>
|| __eq_iter_empty<_Tp>
constexpr bool
- operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>())
{
if constexpr (__member_empty<_Tp>)
return bool(__t.empty());
template<__maybe_borrowed_range _Tp>
requires __member_data<_Tp> || __begin_data<_Tp>
constexpr auto
- operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp>())
- [[nodiscard]]
+ operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp>())
{
if constexpr (__member_data<_Tp>)
return __t.data();
#if __cpp_lib_three_way_comparison
template<typename _IteratorL, typename _IteratorR, typename _Container>
- requires requires (_IteratorL __lhs, _IteratorR __rhs)
- { { __lhs == __rhs } -> std::convertible_to<bool>; }
+ [[nodiscard]]
constexpr bool
operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
noexcept(noexcept(__lhs.base() == __rhs.base()))
- [[nodiscard]]
+ requires requires {
+ { __lhs.base() == __rhs.base() } -> std::convertible_to<bool>;
+ }
{ return __lhs.base() == __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Container>
+ [[nodiscard]]
constexpr std::__detail::__synth3way_t<_IteratorR, _IteratorL>
operator<=>(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
noexcept(noexcept(std::__detail::__synth3way(__lhs.base(), __rhs.base())))
- [[nodiscard]]
{ return std::__detail::__synth3way(__lhs.base(), __rhs.base()); }
#else
// Forward iterator requirements
template<typename _It2, sentinel_for<_It> _Sent2>
requires sentinel_for<_Sent, _It2>
friend bool
- operator==(const common_iterator& __x,
- const common_iterator<_It2, _Sent2>& __y)
- [[nodiscard]]
+ operator== [[nodiscard]] (const common_iterator& __x,
+ const common_iterator<_It2, _Sent2>& __y)
{
switch(__x._M_index << 2 | __y._M_index)
{
template<typename _It2, sentinel_for<_It> _Sent2>
requires sentinel_for<_Sent, _It2> && equality_comparable_with<_It, _It2>
friend bool
- operator==(const common_iterator& __x,
- const common_iterator<_It2, _Sent2>& __y)
- [[nodiscard]]
+ operator== [[nodiscard]] (const common_iterator& __x,
+ const common_iterator<_It2, _Sent2>& __y)
{
switch(__x._M_index << 2 | __y._M_index)
{
template<sized_sentinel_for<_It> _It2, sized_sentinel_for<_It> _Sent2>
requires sized_sentinel_for<_Sent, _It2>
friend iter_difference_t<_It2>
- operator-(const common_iterator& __x,
- const common_iterator<_It2, _Sent2>& __y)
- [[nodiscard]]
+ operator- [[nodiscard]] (const common_iterator& __x,
+ const common_iterator<_It2, _Sent2>& __y)
{
switch(__x._M_index << 2 | __y._M_index)
{
#endif
template<typename _Tp1, typename _Seq1>
- _GLIBCXX_NODISCARD
friend bool
operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1>
- _GLIBCXX_NODISCARD
friend bool
operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
#if __cpp_lib_three_way_comparison
template<typename _Tp1, three_way_comparable _Seq1>
- [[nodiscard]]
friend compare_three_way_result_t<_Seq1>
operator<=>(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
#endif
|| __detail::__can_ref_view<_Range>
|| __detail::__can_subrange<_Range>
constexpr auto
- operator()(_Range&& __r) const
+ operator() [[nodiscard]] (_Range&& __r) const
noexcept(_S_noexcept<_Range>())
- [[nodiscard]]
{
if constexpr (view<decay_t<_Range>>)
return std::forward<_Range>(__r);
template<viewable_range _Range, typename _Pred>
requires __detail::__can_filter_view<_Range, _Pred>
constexpr auto
- operator()(_Range&& __r, _Pred&& __p) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Pred&& __p) const
{
return filter_view(std::forward<_Range>(__r), std::forward<_Pred>(__p));
}
template<viewable_range _Range, typename _Fp>
requires __detail::__can_transform_view<_Range, _Fp>
constexpr auto
- operator()(_Range&& __r, _Fp&& __f) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Fp&& __f) const
{
return transform_view(std::forward<_Range>(__r), std::forward<_Fp>(__f));
}
template<viewable_range _Range, typename _Tp>
requires __detail::__can_take_view<_Range, _Tp>
constexpr auto
- operator()(_Range&& __r, _Tp&& __n) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Tp&& __n) const
{
return take_view(std::forward<_Range>(__r), std::forward<_Tp>(__n));
}
template<viewable_range _Range, typename _Pred>
requires __detail::__can_take_while_view<_Range, _Pred>
constexpr auto
- operator()(_Range&& __r, _Pred&& __p) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Pred&& __p) const
{
return take_while_view(std::forward<_Range>(__r), std::forward<_Pred>(__p));
}
template<viewable_range _Range, typename _Tp>
requires __detail::__can_drop_view<_Range, _Tp>
constexpr auto
- operator()(_Range&& __r, _Tp&& __n) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Tp&& __n) const
{
return drop_view(std::forward<_Range>(__r), std::forward<_Tp>(__n));
}
template<viewable_range _Range, typename _Pred>
requires __detail::__can_drop_while_view<_Range, _Pred>
constexpr auto
- operator()(_Range&& __r, _Pred&& __p) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Pred&& __p) const
{
return drop_while_view(std::forward<_Range>(__r),
std::forward<_Pred>(__p));
template<viewable_range _Range>
requires __detail::__can_join_view<_Range>
constexpr auto
- operator()(_Range&& __r) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r) const
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3474. Nesting join_views is broken because of CTAD
template<viewable_range _Range, typename _Pattern>
requires __detail::__can_lazy_split_view<_Range, _Pattern>
constexpr auto
- operator()(_Range&& __r, _Pattern&& __f) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Pattern&& __f) const
{
return lazy_split_view(std::forward<_Range>(__r), std::forward<_Pattern>(__f));
}
template<viewable_range _Range, typename _Pattern>
requires __detail::__can_split_view<_Range, _Pattern>
constexpr auto
- operator()(_Range&& __r, _Pattern&& __f) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r, _Pattern&& __f) const
{
return split_view(std::forward<_Range>(__r), std::forward<_Pattern>(__f));
}
{
template<input_or_output_iterator _Iter>
constexpr auto
- operator()(_Iter __i, iter_difference_t<_Iter> __n) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Iter __i, iter_difference_t<_Iter> __n) const
{
if constexpr (random_access_iterator<_Iter>)
return subrange(__i, __i + __n);
requires __detail::__already_common<_Range>
|| __detail::__can_common_view<_Range>
constexpr auto
- operator()(_Range&& __r) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r) const
{
if constexpr (__detail::__already_common<_Range>)
return views::all(std::forward<_Range>(__r));
|| __detail::__is_reversible_subrange<remove_cvref_t<_Range>>
|| __detail::__can_reverse_view<_Range>
constexpr auto
- operator()(_Range&& __r) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r) const
{
using _Tp = remove_cvref_t<_Range>;
if constexpr (__detail::__is_reverse_view<_Tp>)
template<viewable_range _Range>
requires __detail::__can_elements_view<_Nm, _Range>
constexpr auto
- operator()(_Range&& __r) const
- [[nodiscard]]
+ operator() [[nodiscard]] (_Range&& __r) const
{
return elements_view<all_t<_Range>, _Nm>{std::forward<_Range>(__r)};
}