SumatraPDF Dev Ditches std::function After 16 Years, Rolls His Own
2025-06-15

After 16 years of C++ development on SumatraPDF, the author abandoned `std::function` and lambdas due to debugging difficulties. Crash reports were hard to decipher because of the auto-generated names of compiler-generated lambda functions. He created simpler, custom callback functions `Func0` and `Func1`. While less feature-rich than `std::function`, they offer significant advantages in memory footprint and compilation speed, and are easier to debug. This post details the design and implementation of `Func0` and `Func1`, and explains why this approach better suits SumatraPDF's needs.
Development
callbacks