#include <iostream>

using namespace std;

template <typename T> const T *ref_to_ptr(const T &x)
{
  return &x;
}

class Test
{
public:
    Test()  { cout << "ctor: " << this << endl; }
    ~Test() { cout << "dtor: " << this << endl; }
};

void print(const Test * val)
{
    cout << val << endl;
}

int main()
{
    print(ref_to_ptr(Test()));
    const Test * ptr = ref_to_ptr(Test());
    print(ptr);
    cout << "The end.\n";
    return 0;
}
