STD::RANGES::EMPTY_VIEW(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 6 versions
, in arch rolling, fedora 44

✨ std::ranges::empty_view< _Tp > ✨

okay bestie so we're in the Library Functions Manual today and the vibe is deliberately nothing πŸ’… no cap, this whole page is about a view that is empty on purpose. it's giving minimalist icon behavior πŸŽ€


🌸 NAME 🌸

std::ranges::empty_view< _Tp > β€” a view that contains no elements. that's it. that's the whole girl. she is empty and she is thriving ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ranges>

she inherits from std::ranges::view_interface< empty_view< _Tp > >, so all that base-class energy comes along for the ride 🫢

πŸ’– Public Member Functions

  • constexpr decltype(auto) back () β€” yep she's got a back(), bestie
  • constexpr auto cbegin () β€” const begin, as one does
  • constexpr auto cend () β€” const end, matching set
  • constexpr decltype(auto) front () β€” and a front() too, main character behavior
  • constexpr operator bool () β€” converts to bool, and it's declared noexcept(noexcept(ranges::empty(_M_derived()))) β€” the noexcept is conditional on whether ranges::empty(_M_derived()) is noexcept, so it's literally inheriting the no-throw vibe from the underlying check πŸ”₯
  • constexpr decltype(auto) operator[] (range_difference_t< _Range > __n) β€” subscript operator, takes a range_difference_t< _Range > __n πŸ“

🌈 Static Public Member Functions

these are static constexpr, so you can call them without an instance β€” iconic, lowkey unbothered πŸ‘‘

  • static constexpr _Tp * begin () noexcept
  • static constexpr _Tp * data () noexcept
  • static constexpr bool empty () noexcept
  • static constexpr _Tp * end () noexcept
  • static constexpr size_t size () noexcept

πŸ‘‘ Detailed Description πŸ‘‘

the actual declaration, verbatim, no edits from me:

template<typename _Tp>
    requires is_object_v<_Tp>
    class std::ranges::empty_view< _Tp >"A view that contains no elements.

so she's a class template over _Tp, constrained by requires is_object_v<_Tp> β€” meaning _Tp has to be an object type or she simply will not participate, periodt πŸ’€

and yes, bestie, that stray " and the trailing description text inside the code block? that's exactly how it shows up in the source. I'm not fixing it, I'm not touching it, we preserve the artifact as-is 🫢 not me being a responsible documentarian.

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code. so like, no human author to stan, just the machine doing its thing πŸ€–βœ¨


and that's the whole page, bestie β€” big kisses from the libstdc++ girlies, this is std::range...iew< _Tp >(3) signing off πŸŽ€πŸ’– (no date on the tin, so take the version as given, iykyk)

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms