Learning Modern C++ Language

Your guide to mastering C++ Language

C++资源,书籍,演讲,论坛,博客,知名库,工具等

书籍

初学者入门,必修几本书,学习C++,除了看视频,和高手交流外,书籍是增强内功的很重要的修为,建议下载到iPad上后,每天早上花费30分钟看一下,坚持1年,一定有很好的收获.可以自行到以下地址获取.书籍格式为PDF,方便阅读.

百度网盘 链接: 提取码: 8ems

For a comprehensive guide to C++ books see the Stackoverflow Definitive C++ Book Guide and List.

工具

  • Compiler Explorer
  • 知名库

  • Boost
  • Abseil
  • Folly
  • spdlog(方便的日志库)
  • fmt(格式化库)
  • nlohmann(json库)
  • Ranges V3(范围库)
  • 社区

    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++:

    Ask your C++ questions:

    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++ 并发编程专家,实现一个线程安全的队列模板类 `ThreadSafeQueue`,要求:
    • 使用 `std::mutex` 和 `std::condition_variable`
    • 提供 `push()`, `try_pop()`, `wait_and_pop()` 方法
    • 支持移动语义(禁用拷贝)
    • 附测试代码:一个生产者线程和两个消费者线程
    用 C++20 `consteval` 实现编译期字符串哈希函数 `hash_str`,要求:
    • 输入字符串字面量,如 `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 而导致的内存管理问题。