Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::take_view<V>::reserve_hint

      From cppreference.com
      <cpp‎ |ranges‎ |take view
       
       
      Ranges library
      Range adaptors
       
       
      constexprauto reserve_hint()
      (1)(since C++26)
      constexprauto reserve_hint()const
      (2)(since C++26)

      LetW beV for overload(1) orconst V for overload(2). Equivalent to

      ifconstexpr(ranges::approximately_sized_range<W>)
      {
          auto n=static_cast<ranges::range_difference_t<W>>(ranges::reserve_hint(base_));
          return to-unsigned-like(ranges::min(n, count_));
      }
      return to-unsigned-like(count_);

      Contents

      [edit]Return value

      The approximate size of the resulting range.

      [edit]Notes

      Feature-test macroValueStdFeature
      __cpp_lib_ranges_reserve_hint202502L(C++26)ranges::approximately_sized_range andreserve_hint(1,2)

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      returns the number of elements, provided only if the underlying (adapted) range satisfiessized_range
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/take_view/reserve_hint&oldid=182446"

      [8]ページ先頭

      ©2009-2026 Movatter.jp