From Jason Turner
Watch on YouTube

Summary

This episode explores `__has_include`, a new feature in C++17 that allows developers to check if a specific header file is available before attempting to include it. Jason demonstrates how this feature simplifies cross-platform development by eliminating complex preprocessor conditionals used to detect operating systems. Using real-world code from ChaiScript as an example, he shows how `__has_include` can directly check for the availability of platform-specific headers like `` or ``, making code cleaner and more maintainable.

Resources

Tags