Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::chunk_by_view<V,Pred>::pred

      From cppreference.com
      <cpp‎ |ranges‎ |chunk by view
       
       
      Ranges library
      Range adaptors
       
       
      constexprconst Pred& pred()const;
      (since C++23)

      Returns a reference to the containedPred object. Equivalent toreturn*pred_;.

      The behavior is undefined ifpred_ does not contain a value.

      [edit]Parameters

      (none)

      [edit]Return value

      A reference to the containedPred object.

      [edit]Example

      Run this code
      #include <cassert>#include <concepts>#include <functional>#include <initializer_list>#include <ranges> int main(){constauto v={1,1,2,2,1,1,1};auto chunks= v| std::views::chunk_by(std::equal_to{});auto pred= chunks.pred();    static_assert(std::same_as<decltype(pred),std::equal_to<>>);assert(pred(v.begin()[0],1));}
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/chunk_by_view/pred&oldid=176643"

      [8]ページ先頭

      ©2009-2025 Movatter.jp