Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:RangeAdaptorClosureObject(since C++20)

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      Range adaptor closure objects areFunctionObjects that are callable via the pipe operator: ifC is a range adaptor closure object andR is arange, these two expressions areequivalent:

      C(R)R| C

      Two range adaptor closure objects can be chained byoperator| to produce another range adaptor closure object: ifC andD are range adaptor closure objects, thenC| D produces a range adaptor closure objectE with the following properties:

      • E stores a copy ofC andD, direct-non-list-initialized fromstd::forward<decltype((C))>(C) andstd::forward<decltype((D))>(D) respectively. If such initialization is invalid,C| D is also invalid.
      • Letc andd be the stored copies (with the same constness and value category asE), andR be arange object, the following expressions areequivalent:
      d(c(R))R| c| dE(R)R| E// R | (C | D)

      Notes:operator() is unsupported for volatile-qualified or const-volatile-qualified version of range adaptor object closure types.

      Objects whose type is the same as one of the following objects (ignoring cv-qualification) are range adaptor closure objects:

      • unary range adaptor objects,
      (since C++23)
      • the results of binding trailing arguments by range adaptor objects, and
      • the results of chaining two range adaptor closure objects byoperator|.

      [edit]See also

      helper base class template for defining a range adaptor closure object
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/RangeAdaptorClosureObject&oldid=174147"

      [8]ページ先頭

      ©2009-2025 Movatter.jp