#ifndef MIGRAPHX_GUARD_TEST_AUTO_PRINT_HPP #define MIGRAPHX_GUARD_TEST_AUTO_PRINT_HPP #include #include struct auto_print { static std::function& get_handler(const std::string& name); static void set_terminate_handler(const std::string& name); std::string name; template auto_print(T& x, std::string s) : name(std::move(s)) { get_handler(name) = [&x] { std::cout << x << std::endl; }; } ~auto_print(); }; #endif