Paul Fultz II (@pfultz2) profile picture
Joined June 2014
Photo by Paul Fultz II (@pfultz2)
Replying to @vzverovich @mknejp
Which breaks generic programming. The same code in vector space should work in scalar space as well.
37
Replying to @mknejp
Yea simd works in vector space so returning a mask is regular. Implicitly going from scalar space to vector space (ie returning a bool) is error prone.
1
472
But returning a bool would implicitly convert the vector to a scalar. This should be explicit.
51
Returning a mask is still regular it’s just a vectorized regular instead of a scalar regular. Of course implicitly going from a vector to a scalar seems very problematic, it should be done explicitly.
2
2
141
Replying to @ericniebler
The recursion trick is from Paul Mensonides and not from me(although I did write about it).
1
3
266
Replying to @ericniebler
Yes using Boost.PP.
322
Replying to @gregcons
Manifiesto - Sonámbulo
85
Replying to @gregcons
Smells like teen spirit
1
124
Replying to @seanbax
Implicit enum conversion is very useful as neither clang-tidy nor cppcheck warn about this either. I have a change to add a check to clang tidy for this(waiting to be merged since summer as llvm is a pain to contribute to): reviews.llvm.org/D129570
42
Cppcheck uses string literals in test cases. For checking diagnostics its pretty horrible, but for checking internal data structures(ie that the ast node has a certain property) it works better I think.
Wouldn’t this just be std::expected<std::optional<>>?
1
1
Replying to @ericniebler
If only C++ could support monadic comprehension as a language feature: [for(auto x:parse_int()) for(auto y:parse_int()) return x+y] The only question is how to express the capturing because async you want by value but for errors and parsing you might want by ref.
2
Replying to @mknejp @visualc
It does the same for enable_if as well. If it can’t get good diagnostics with something a decade old, i would expect much less with a newer language feature.
I always construct them, and others on projects I worked would use this style as well. Using ::value is very c++98 style.
1
Yea the lazy eval is important. Its too bad we have to write: lazy_and<is_bar<T>, is_foo<T>>{} instead of: is_bar<T>{} and is_foo<T>{} Just to get compile-time short-circuiting.
1
If only the standard allowed is_foo<T> to be a template alias. You get the pros of using integral_constant without perf penalty, plus user specialization would be a clear compile error.
1
1
Sorry, CSE = Common Subexpression Elimination
It would have been better to amortize with CSE instead of caching.
1
Yea that’s why I consider mutating/caching views as single pass ranges.
Why can’t you use default capture instead?
1