This documentation is automatically generated by online-judge-tools/verification-helper
#include "src/Helper/MakeFixPoint.hpp"
ラムダ式による再帰のヘルパー
int main() {
dfs = make_fix_point([&](auto&& self) -> T {
return self();
});
dfs();
}
/// @docs src/Helper/MakeFixPoint.md
template <typename F> struct FixPoint : F {
FixPoint(F&& f) : F(std::forward<F>(f)) {}
template <typename... Args> decltype(auto) operator()(Args&&... args) const {
return F::operator()(*this, std::forward<Args>(args)...);
}
};
template <typename F> decltype(auto) make_fix_point(F&& f) { return FixPoint<F>{std::forward<F>(f)}; }
#line 1 "src/Helper/MakeFixPoint.hpp"
/// @docs src/Helper/MakeFixPoint.md
template <typename F> struct FixPoint : F {
FixPoint(F&& f) : F(std::forward<F>(f)) {}
template <typename... Args> decltype(auto) operator()(Args&&... args) const {
return F::operator()(*this, std::forward<Args>(args)...);
}
};
template <typename F> decltype(auto) make_fix_point(F&& f) { return FixPoint<F>{std::forward<F>(f)}; }