jfalcou / kumi

C++20 Compact Tuple Tools
https://jfalcou.github.io/kumi/
Boost Software License 1.0
47 stars 7 forks source link

Add support for `std::invoke`-like calls in `apply`. #81

Closed jehelset closed 6 months ago

jehelset commented 1 year ago

Also adds noexcept spec via is_nothrow_invocable type-trait.

jehelset commented 1 year ago

@jfalcou i will add some more tests (hence draft), just wondering if general shape is ok.

jfalcou commented 11 months ago

OOh forgot to reply here.

The failures :

/Users/runner/work/kumi/kumi/include/kumi/utils/apply.hpp:16:41: error: no template named 'unwrap_reference_t' in namespace 'std'; did you mean 'unwrap_reference'?
      !std::is_same_v<std::decay_t<std::unwrap_reference_t<T &&>>, std::unwrap_ref_decay_t<T &&>>;
                                   ~~~~~^~~~~~~~~~~~~~~~~~
                                        unwrap_reference
/Users/runner/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/utility:644:8: note: 'unwrap_reference' declared here
struct unwrap_reference : __unwrap_reference<_Tp> { };
       ^
In file included from /Users/runner/work/kumi/kumi/test/doc/adapt.cpp:6:
In file included from /Users/runner/work/kumi/kumi/include/kumi/tuple.hpp:[15](https://github.com/jfalcou/kumi/actions/runs/7024999372/job/19114937475#step:4:16):
In file included from /Users/runner/work/kumi/kumi/include/kumi/utils.hpp:34:
/Users/runner/work/kumi/kumi/include/kumi/utils/apply.hpp:[16](https://github.com/jfalcou/kumi/actions/runs/7024999372/job/19114937475#step:4:17):73: error: no template named 'unwrap_ref_decay_t' in namespace 'std'; did you mean 'unwrap_ref_decay'?
      !std::is_same_v<std::decay_t<std::unwrap_reference_t<T &&>>, std::unwrap_ref_decay_t<T &&>>;
                                                                   ~~~~~^~~~~~~~~~~~~~~~~~
                                                                        unwrap_ref_decay

comes from the incomplete android STL, just use typename unwrap<...>::type