Library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub maguroplusia/Library

:warning: Other/LambdaRecursion.cpp

Code

template<typename F>
struct FixPoint : F {
    template<typename G>
    FixPoint(G&& g) : F{std::forward<G>(g)} {}

    template<typename... Args>
    decltype(auto) operator()(Args&&... args) const {
        return F::operator()(*this,std::forward<Args>(args)...);
    }
};

#if defined(__cpp_deduction_guides)
template<typename F>
FixPoint(F&&) -> FixPoint<std::decay_t<F>>;
#endif

template<typename F>
inline FixPoint<std::decay_t<F>> fix(F&& f) {
    return std::forward<std::decay_t<F>>(f);
}
#line 1 "Other/LambdaRecursion.cpp"
template<typename F>
struct FixPoint : F {
    template<typename G>
    FixPoint(G&& g) : F{std::forward<G>(g)} {}

    template<typename... Args>
    decltype(auto) operator()(Args&&... args) const {
        return F::operator()(*this,std::forward<Args>(args)...);
    }
};

#if defined(__cpp_deduction_guides)
template<typename F>
FixPoint(F&&) -> FixPoint<std::decay_t<F>>;
#endif

template<typename F>
inline FixPoint<std::decay_t<F>> fix(F&& f) {
    return std::forward<std::decay_t<F>>(f);
}
Back to top page