Most classes should not directly handle resources, but instead, use members that perform resource handling for them:
For memory, it can be std::unique_ptr, std::shared_ptr, std::vector…For files, it can be std::ofstream, std::ifstream……
Classes …
欢迎加入我的训练营:云原生 AI 实战营,一个助力 Go 开发者在 AI 时代建立技术竞争力的实战营。实战营中包含大量 Go、云原生、AI Infra 相关的优质实战课程和项目。欢迎关注我的公众号:令飞编程,持续分享 Go、云原生、AI Infra 技…