The Detection Idiom - A Simpler Way to SFINAE

By Marshall Clow

Hidden in the Library fundamentals Technical Specification, there is a section called "Detection idiom". The specification doesn’t really say what it is for, and it has not received a lot of notice.

That’s a shame. This is an amazingly powerful method for distinguishing between kinds of types. Writing SFINAE constraints is tedious and confusing, and this will make them much easier to do.

This session will introduce the detection idiom, talk about how it works, and then give examples on how to use it.

A basic knowledge of template meta-programming will be useful