C++资源,书籍,演讲,论坛,博客,知名库,工具等
书籍
初学者入门,必修几本书,学习C++,除了看视频,和高手交流外,书籍是增强内功的很重要的修为,建议下载到iPad上后,每天早上花费30分钟看一下,坚持1年,一定有很好的收获.可以自行到以下地址获取.书籍格式为PDF,方便阅读.
百度网盘 链接: 提取码: 8ems
- 代码大全2
- C++ API设计
- C++并发编程实战
- Effective Modern C++
- Modern C++ Design
- C++ Concurrency in Action
- Modern C++学习笔记
- A Tour of C++ (Bjarne Stroustrup) [C++11/17/20]
- The C++ Programming Language (Bjarne Stroustrup) [C++11]
- Effective Modern C++ (Scott Meyers) [C++11/14]
- Overview of the New C++ (Scott Meyers) [C++11/14]
- C++ Core Guidelines (Bjarne Stroustrup, Herb Sutter) Guidelines for using modern C++.
- C++ Core Guidelines中文版 (Bjarne Stroustrup, Herb Sutter) Guidelines for using modern C++.
- C++ Concurrency in Action (Anthony Williams) [C++11/14/17] - Reference and guide to writing multi-threaded code with standard C++.
- C++17 - The Complete Guide (Nicolai M. Josuttis) [C++17] - Giving guidance on how to use Language and Library Features of C++17.
- Professional CMake (Craig Scott) - A practical guide for using CMake to build your C++ projects.
- Modern C++ Tutorial: C++ 11/14/17/20 On the Fly (Changkun Ou) - The book claims to be "On the Fly". Its intent is to provide a comprehensive introduction to the relevant features regarding modern C++ (before 2020s).
For a comprehensive guide to C++ books see the Stackoverflow Definitive C++ Book Guide and List.
工具
知名库
社区
Find the latest C++ news and updates:
Listen to the latest C++ podcasts:
- CppCast ([YouTube](https://www.youtube.com/channel/UCuCjADS4u3uJDTqUaG0H9dA), [Twitter](https://twitter.com/cppcast)) - The first podcast by C++ developers for C++ developers!
- Cpp.chat ([YouTube](https://www.youtube.com/channel/UCsefcSZGxO9lTBqFbsV3sJg/featured), [Twitter](https://twitter.com/cppchat)) - Comments on c++ and issues of interest to c++ programmers.
- C++ Weekly - Educational videos by Jason Turner.
Read the latest C++ standard proposals:
Discuss everything related to C++:
- r/cpp - The C++ subreddit.
- C++ Slack - The C++ Slack workspace.
- CoreHard Telegram group
Ask your C++ questions:
- r/cpp_questions - A subreddit for C++ questions and answers.
Deref coercion
Deref coercion 在 Rust 里,解引用强制转换(Deref coercion)是一项很有用的特性,它能自动把引用类型转换为其他引用类型。这一特性让代码更具灵活性和可读性。以下是对 Rust 解引用强制转换的详细介绍: 工作原理: 当函数或方法期望的是某种引用类型,而传入的却是另一种引用类型时,解引用强制转换就会发挥作用。Rust 会自动调用`Deref`或`DerefMut`特性的`deref`方法,从而将传入的引用类型转换为所需的类型。
CRTP(Curiously Recurring Template Pattern)
**CRTP(Curiously Recurring Template Pattern)** 是一种通过模板继承实现的**静态多态**技术,其核心思想是**基类将派生类作为模板参数**,从而在编译时实现多态行为.
C++ AI 提示词 (Prompt)
C++ 提示设计核心原则
- 明确目标:指定代码功能(如算法、数据结构、类设计)。
- 约束条件:限定 C++ 标准(C++11/17/20)、代码风格(Google/LLVM)、依赖库(STL/Boost)。
- 示例驱动:提供输入/输出样例或代码片段,明确期望。
- 错误处理:要求异常捕获、边界检查或防御性编程。
- 使用 `std::mutex` 和 `std::condition_variable`
- 提供 `push()`, `try_pop()`, `wait_and_pop()` 方法
- 支持移动语义(禁用拷贝)
- 附测试代码:一个生产者线程和两个消费者线程
- 输入字符串字面量,如 `hash_str("hello")`
- 输出 `constexpr uint32_t` 类型的 FNV-1a 哈希值
- 禁止使用运行时计算
std::enable_shared_from_this
std::enable_shared_from_this 是 C++ 标准库提供的一个模板类,用于解决 对象在成员函数中需要安全获取指向自身的 std::shared_ptr 的问题。它的核心作用是确保多个 std::shared_ptr 实例共享同一对象的引用计数,避免因错误创建多个独立的 std::shared_ptr 而导致的内存管理问题。