Commit 1c82263b authored by Paul's avatar Paul
Browse files

Simplify auto_print

parent 8e5f23c9
......@@ -22,11 +22,11 @@
struct auto_print
{
static std::array<std::function<void()>, 2> handlers;
migraph::program& p;
int index;
auto_print(migraph::program& pp, int i) : p(pp), index(i)
template<class T>
auto_print(T& x, int i) : index(i)
{
handlers[index] = [this] { std::cout << p << std::endl; };
handlers[index] = [&x] { std::cout << x << std::endl; };
}
~auto_print()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment