Comments (4)
filter
requires a indirect_unary_predicate
, which requires the predicate to be callable with different types of arguments, and return a boolean-testable type in each case.
As you correctly identified, calling the predicate with the iterator's value_type
is checked by the concept, but is not executed. Call with a dereferenced iterator is checked and executed.
With -> bool
, the lambda body is not instantiated when checking the return type, so the validity of std::get<A&>(el)
is not checked by the concept.
Blame the authors of ranges-v3 for the design of indirect_unary_predicate
:)
from stl.
On a related note, I just filed #4575 because the diagnostic for bogus get-by-type is very confusing.
from stl.
Thank you for the responses, really appreciate the time you both spent on this.
@StephanTLavavej @CaseyCarter If there's nothing else to be actioned on your end, I'm happy for this to be closed off.
from stl.
Sounds good to me! Casey offered to provide additional clarification if necessary but if you're happy then we're happy.
from stl.
Related Issues (20)
- `<ranges>`: Poor error message when `ranges::to` cannot find a way to create the result
- operator delete calls _free_dbg(_UNKNOWN_BLOCK) in debug builds and it crashes when the user has replaced malloc() and free() HOT 11
- `<numeric>`: reduce/scan algorithms aren't enforcing their Mandates HOT 2
- `<tuple>`: Confusing diagnostic for `get<T>()` when the type doesn't occur exactly once
- `<ranges>`: `iota_view` and `_Counted_fn` inconsistently use `_STL_ASSERT` for precondition checking HOT 3
- Wiki: `Benchmarking-the-STL.md` mentions obsolete `BENCHMARK_TEMPLATE<N>` macros
- Wiki: `Benchmarking-the-STL.md` diverges from `README.md`
- `README.md`: Update working draft revision to N4981
- `<type_traits>`: `__vectorcall` _should_ be rejected on ARM64EC but isn't HOT 1
- `<utility>`: Side effects in self-swaps of `pair` are skipped HOT 1
- Test issue HOT 1
- `std::isfinite` poor codegen with Microsoft STL + Clang HOT 6
- Unable to run tests with `subst` drive letters HOT 3
- Is it by design that `<string_view>` provides most contents of `<string>`? HOT 1
- Optimize P3142R0 Printing Blank Lines With `println()`
- Submodule checkout failure should short-circuit checks
- `P2286R8_text_formatting_tuple` fails on non-English locale HOT 1
- `<format>`: Call to `next_arg_id` may result in unexpected error (regression)
- Warn/block building in wrong command prompt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stl.