I SPY with my little eye Boost.Predef in a constexpr world
summary
A tiny library called spy provides a constexpr-compatible Boost.Predef clone that exposes objects like spy::gcc and spy::os so code can write if constexpr tests against compiler, platform, and feature versions. It discovers that plain if constexpr still parses unused branches so it adds patterns using templates and concepts to avoid ill-formed code, and offers a runtime CPUID wrapper for CPU feature detection. The crate is rough but practical and compiles in real projects.
AI-written summary · about
chapters (4)
- 0:00Modern C++ and macros
- 0:31Introducing the spy library
- 2:15Limitations of constexpr
- 4:42Future potential and closing
related talks
51mCompile-time tools supporting generic programming in C++
22mBoosting Compiler Testing by Injecting Real-World Code
01h 04mconstexpr: Introduction
01h 01mA Soupçon of SFINAE
01h 27mC++ Reflection - Back on Track
01h 01mMeta
01h 04mC++ Insights: Peek behind the curtains of your C++ compiler
41mEverything you want to know about C/C++ pre-processor but couldn't ask
