Possible Duplicate:
Is it possible to write a C++ template to check for a function's existence?
I'm trying to do a sort of a compile time duck-typing. I want to call the method if T has it, otherwise do nothing. This could be implemented as template function that does nothing, with a specialization that calls the method. But how to select the specialization only if T has a foo()?