GuillaumeDua / CppShelf

Collection of powerfuls - C++ Single-Header Libraries Files
https://guillaumedua.github.io/CppShelf/
MIT License
9 stars 1 forks source link

[ag] apply #242

Closed GuillaumeDua closed 1 month ago

GuillaumeDua commented 2 months ago
template <typename F, csl::ag::aggregate aggregate_t>
constexpr decltype(auto) apply(F && f, aggregate_t && value)
noexcept(std::nothrow_invocable<F, csl::ag::elements<indexes, aggregate_t>...>)
{
   return std::invoke(fwd(f), fwd(csl::ag::get<indexes>(value))...);
}
GuillaumeDua commented 1 month ago

Done with 4f2b2ee