| 1234567891011121314151617181920212223242526 |
- //
- // invoke.h
- // stream
- //
- // Created by Sam Jaffe on 4/2/23.
- //
- #pragma once
- #include <stream/detail/macro.h>
- namespace stream::detail {
- template <typename F, typename T, typename Proj>
- decltype(auto) invoke(F && func, T && t, Proj && proj) {
- return std::invoke(FWD(func), std::invoke(FWD(proj), FWD(t)));
- }
- template <typename F, typename T1, typename T2, typename Proj1, typename Proj2>
- decltype(auto) invoke(F && func, T1 && t1, T2 && t2, Proj1 && proj1,
- Proj2 && proj2) {
- return std::invoke(FWD(func), std::invoke(FWD(proj1), FWD(t1)),
- std::invoke(FWD(proj2), FWD(t2)));
- }
- }
- #include <stream/detail/undef.h>
|