Template Function sequant::opt::detail::option_engaged

Function Documentation

template<typename F>
constexpr bool sequant::opt::detail::option_engaged(F const &f)

Whether an “option-like” callable is engaged.

std::function and function pointers report their non-empty state via contextual conversion to bool; any other callable (e.g. a plain lambda) has no empty state and is always engaged. This lets cost helpers accept either a (possibly empty) std::function or a bare lambda for optional callables such as inner_pow, instead of requiring a bool-convertible type.