fyfn(3) | fyfn(3) |
fyfn - adapt function to factory
#include <cfl/containers/fyfn.hpp>
auto g = fyfn <FY> (f);
Adapt function f
to factory FY
. Roughly, the result (g
) above is an object
behaving like the type G
below.
template <template <typename...> class FY, typename F>
struct G
{
F f;
G (F && f) : f (f) {}
template <typename... U>
auto operator () (U &&... u)
{
return FY <F, U...>::value (f, u...);
}
};
Used for implementation details, and is not intended for the end user.
Another function, where f
is adapted to FY
.
A standard CFL function. The corresponding factory fyfn_
is non-standard
though. For compliance, a std_fyfn_
is provided.