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

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.