Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::iota_view<W, Bound>::empty

      From cppreference.com
      <cpp‎ |ranges‎ |iota view
       
       
      Ranges library
      Range adaptors
       
      std::ranges::iota_view
      Member functions
      iota_view::empty
      Deduction guides
      Nested classes
      Iterator
      Helper concepts
      Member types
      Member functions
      Non-member functions
      Sentinel
      Member functions
      Non-member functions
       
      constexprbool empty()const;
      (since C++20)

      Checks whether the range is empty (i.e. whether the beginning value is the same as the sentinel value).

      Contents

      [edit]Return value

      value_ == bound_

      [edit]Example

      Run this code
      #include <cassert>#include <ranges> int main(){auto a= std::ranges::iota_view<int,int>();assert(a.empty()); auto b= std::ranges::iota_view(4);assert(!b.empty()); auto c= std::ranges::iota_view(4,8);assert(!c.empty());}

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 4001C++20the inherited memberempty function was not always validempty is always provided

      [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/iota_view/empty&oldid=176919"

      [8]ページ先頭

      ©2009-2025 Movatter.jp