CSGuide
CSGuide copied to clipboard
🔥 计算机学习路线,包括科班、非科班、Web、全栈、C++、Java、System等
path: docs/cpp/basics/class_and_struct.md ``` 也就是说,能用 C 的 memcpy() 等函数进行操作的类、结构体就是 POD 类型的数据。 作者: 编程指北 链接: https://csguide.cn/cpp/basics/class_and_struct.html#%E4%B8%8D%E5%90%8C%E7%82%B9 来源: https://csguide.cn 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 ``` pod 是平凡和标准布局的统称,你的描述是标准布局而非pod
在Github上添加LICENSE文件,内含版权声明。(不论是ARR还是自由文档,请明示)
在 [docs/cpp/modern_cpp/type_traits.md](https://github.com/imarvinle/CSGuide/blob/ba21398cc44e335c749c01b7478e1750588c49e6/docs/cpp/modern_cpp/type_traits.md) 展示如何实现 `is_integral` 模板时,使用了 `std::remove_cv` 模板,这是不应该使用的。对于 `int` 和 `int&` 两个类型,`std::is_integral::value` 分别是真和假。 见 godbolt [例子](https://godbolt.org/z/d3Ws3bqPW)。
对于 https://csguide.cn/cpp/object_oriented/deep_copy_and_shallow_copy.html 中的代码有些疑问:作者给出的代码即使我删去深拷贝的部分,也就如下代码,仍然没有出现修改一方会影响另一方的现象 ``` #include #include class MyClass { public: MyClass(const char* str) { data = new char[strlen(str) + 1]; strcpy(data, str); } // 深拷贝的拷贝构造函数 // MyClass(const MyClass& other) {...