#include<iostream>
#include <type_traits>

using namespace std;


template <class TO, class FROM>
typename enable_if<!is_pointer<FROM>::value, TO>::type
punning_cast(const FROM &input) {
	cout << "reference version" << endl;
}

template <class TO, class FROM>
typename enable_if<is_pointer<FROM>::value, TO>::type
punning_cast(const FROM input) {
	cout << "pointer version" << endl;
}

int main()
{
	int k(0);
	int *p = &k;

	punning_cast<void>(k);
	punning_cast<void>(p);

	return 0;
}