Repository navigation
Rewrite not_tuple, add FWD macro - #13
Conversation
f7cf440 to
c3b3454
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
- Coverage 99.09% 98.91% -0.18%
==========================================
Files 10 9 -1
Lines 110 92 -18
Branches 6 6
==========================================
- Hits 109 91 -18
Partials 1 1 ☔ View full report in Codecov by Sentry. |
| requires std::invocable<decltype(fn), | ||
| decltype(std::forward<decltype(v)>(v).value())> | ||
| requires std::invocable<decltype(fn), decltype(FWD(v).value())> | ||
| && (!std::is_void_v<decltype(v.value())>) |
There was a problem hiding this comment.
I have a feeling you might be better off if you made a "some_void_expected" concept...
In that case, you probably don't need this restriction at all, since the above invocable will SFINAE anyway, and then the below one is the right one if you also constrain it with some_void_expected
There was a problem hiding this comment.
good idea, will switch to concepts in a separate PR
| detail::get<I>(std::forward<decltype(self)>(self).data)...); | ||
| }(std::make_integer_sequence<unsigned, size>{}); | ||
| constexpr static typename functor_type::apply fn{}; | ||
| return data_t::invoke(FWD(self).data, FWD(fn), FWD(v)); |
There was a problem hiding this comment.
this peeves me off - would be so nice if we inlined not_tuple into here and just... not have two more inlining contexts...
future improvement.
ed9a2e9 to
4e16405
Compare
4e16405 to
2dcff6f
Compare
A minor change to rewrite (and simplify)
not_tuple, gets rid ofgetinterface (another reason to call it "not tuple") and instead limits the interface to function invocation only (which is exactly whatfunctorneeds). With thanks to @atomgalaxy for the idea.Also added
FWDmacro and reorganised small bits and pieces intoutility.hppheader.