/* probes.d */ provider myprobes { probe swap(const char*); }; /* main.cpp */ #include #include "probes.h" #include template void swap(T& first, T& second) { MYPROBES_SWAP((char *) typeid(first).name()); T temp; temp = first; first = second; second = temp; } int main() { int first = 12; int second; std::cin >> second; std::cout << "first: " << first << " second: " << second << std::endl; swap(first, second); std::cout << "first: " << first << " second: " << second << std::endl; return 0; }