microsoft / cppwin32

A modern C++ projection for the Win32 SDK
MIT License
441 stars 30 forks source link

Feedback #14

Open swang206 opened 3 years ago

swang206 commented 3 years ago
  1. Too many static in header files. They should be "inline", instead of static. The inline means the compiler should discard duplicated symbols. If you use static, it bloats the functions for every translation unit. https://devblogs.microsoft.com/oldnewthing/20200521-00/?p=103777
  2. It looks like some functions are no marks in headers. That violates ODR and makes compilation impossible.
  3. We cannot use anything that relates to iostream, including filesystem. iostream introduces dead virtual functions in the binary that bloats a lot of binary size.
  4. include. Windows.h is a large header file. It is extremely slow. The correct way is of course to declare functions by yourself and then use linker comments to link against them.
  5. Even std::string, std::array need to be used carefully because they bloat compilation time. Particularly std::string