
Mathias Gaunard a écrit :
Robert Jones wrote:
Somewhere in the Boost headers, or maybe the Boost documentation I have seen a bit of code which uses SFINAE, and also possibly the enable_if header to select either a find class method or find global template depending on what's available. That's something that was already explained indeed. Here is a way to do it. Let's say you want to test for presence of a go() method with the following prototype :
void go();
in any type :
typedef char NotFound; struct Found { char x[2]; };
template