#pragma once #include namespace pid_control { struct VariantToDoubleVisitor { template std::enable_if_t::value, double> operator()(const T& t) const { return static_cast(t); } template std::enable_if_t::value, double> operator()(const T& t) const { throw std::invalid_argument("Cannot translate type to double"); } }; } // namespace pid_control