r/cpp • u/victor-s8n • 27d ago
How I design C++ classes
https://rafb.eu/blog/cpp-class-design/This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
66
Upvotes
r/cpp • u/victor-s8n • 27d ago
This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
View all comments
Show parent comment
1
u/victor-s8n 23d ago
Let's go with `#include <regex>`. If you include it in your header, because you want it as a member-variable, all other #includes of that header will include `<regex>`. Although <regex> is only used internally inside the class. <regex> is known to compile slow.
If you now create a class to hide regex for a specific use-case, you get a pimpl or my approach.