STD::RANGES::EMPTY_VIEW(3)
β¨ 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 aback(), bestieconstexpr auto cbegin ()β const begin, as one doesconstexpr auto cend ()β const end, matching setconstexpr decltype(auto) front ()β and afront()too, main character behaviorconstexpr operator bool ()β converts to bool, and it's declarednoexcept(noexcept(ranges::empty(_M_derived())))β the noexcept is conditional on whetherranges::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 arange_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 () noexceptstatic constexpr _Tp * data () noexceptstatic constexpr bool empty () noexceptstatic constexpr _Tp * end () noexceptstatic 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