fyfn(3) fyfn(3)

NAME

fyfn - adapt function to factory

SYNOPSIS

#include <cfl/containers/fyfn.hpp>

auto g = fyfn <FY> (f);

DESCRIPTION

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.

RETURN VALUES

Another function, where f is adapted to FY.

STANDARDS

A standard CFL function. The corresponding factory fyfn_ is non-standard though. For compliance, a std_fyfn_ is provided.