[libcu++] Indirect indirect_binary invocable#9417
Conversation
OverviewThis pull request introduces ChangesCore Implementation
Added two new iterator indirect-callability concepts:
Both concepts require:
Implementation integrates with existing iterator concepts and predicates (matching the project's concept/macro fallbacks where applicable). Test Coverage
Comprehensive compile-time validation featuring:
Mirrors the binary invocable test structure with regular invocation semantics, validating both positive and negative cases for Test Support
Added Impact
Walkthroughsuggestion: PR adds two binary iterator invocable concepts with parallel macro-based fallbacks, compile-pass tests for both positive and negative cases, and a small test-support helper for indirectly readable iterators. ChangesBinary invocable concepts
Comment |
c92d1d8 to
82af814
Compare
This comment has been minimized.
This comment has been minimized.
The standard currently does only know `indirectly_unary_invocable`. However, there are a lot of algorithms like `adjacent_difference` where we want to make sure that we can invoke a functor by dereferencing two iterators. Add this as an extension
82af814 to
4171c33
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
libcudacxx/test/libcudacxx/std/iterators/iterator.requirements/indirectcallable/indirectinvocable/indirectly_binary_invocable.compile.pass.cpp (1)
37-43: ⚡ Quick winsuggestion: Add the symmetric unreadable-
I2negative assertion here.indirectly_binary_invocablerequires both iterator operands to satisfyindirectly_readable, but this file only proves the failure whenI1is unreadable. A typo in either implementation path that re-checksI1and forgetsI2would still pass this test. As per coding guidelines,libcudacxx/**/*reviews should focus on correctness, standard-library conformance, tests, and portability across supported CUDA toolchains.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 99343c8f-2a76-4650-bc9f-ad9cd070c81d
📒 Files selected for processing (4)
libcudacxx/include/cuda/std/__iterator/concepts.hlibcudacxx/test/libcudacxx/std/iterators/iterator.requirements/indirectcallable/indirectinvocable/indirectly_binary_invocable.compile.pass.cpplibcudacxx/test/libcudacxx/std/iterators/iterator.requirements/indirectcallable/indirectinvocable/indirectly_regular_binary_invocable.compile.pass.cpplibcudacxx/test/support/indirectly_readable.h
🚧 Files skipped from review as they are similar to previous changes (3)
- libcudacxx/test/support/indirectly_readable.h
- libcudacxx/include/cuda/std/__iterator/concepts.h
- libcudacxx/test/libcudacxx/std/iterators/iterator.requirements/indirectcallable/indirectinvocable/indirectly_regular_binary_invocable.compile.pass.cpp
🥳 CI Workflow Results🟩 Finished in 1h 35m: Pass: 100%/118 | Total: 2d 14h | Max: 1h 20m | Hits: 67%/530703See results here. |
| _CCCL_CONCEPT indirectly_copyable_storable = _CCCL_FRAGMENT(__indirectly_copyable_storable_, _In, _Out); | ||
|
|
||
| template <class _Fp, class _It1, class _It2> | ||
| _CCCL_CONCEPT indirectly_binary_invocable = _CCCL_REQUIRES_EXPR((_Fp, _It1, _It2))( |
There was a problem hiding this comment.
Can we just combine these into just the _CCCL_CONCEPT form instead of duplicating? This is a massive concept to write out twice.
The standard currently does only know
indirectly_unary_invocable. However, there are a lot of algorithms likeadjacent_differencewhere we want to make sure that we can invoke a functor by dereferencing two iterators.Add this as an extension