#include #include using namespace std; class detectable {}; inline void operator*(int i, detectable d) {cout << "multiply\n";} inline void operator&(int i, detectable d) {cout << "bitwise and\n";} int i = 10; detectable p; detectable r; //T must be a class with a static member function x, or a static data //member x with an operator() member function that takes one int argument. //T must also have static data members y and z that are convertible to int. template void f() { //Pass the argument i to a static member function named T::x, or to an //operator() member function of a static data member named T::x. T::x(i); //Multiply a static data member named T::y times p. T::y * p; //"Bitwise and" a static data member named T::z with r. T::z & r; //Did not create any local variables named i, p, r. } class myclass { public: static void x(int i) {cout << "myclass::x(" << i << ")\n";} static const int y = 10; static const int z = 20; }; int main() { f(); return EXIT_SUCCESS; }