<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot;]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/Sunrisepeak/mcpp-standard" rel="nofollow ugc"><strong>mcpp-standard</strong></a>是一个强调动手实践的现代C++核心语言特性教程项目。基于对"编译器驱动开发模式"的扩展, 把每个C++核心语言特性设计成对应的练习代码"关卡", 并结合<strong>自动化的代码检测</strong>工具, 提供了一种具有交互感(式)的方式来学习现代C++和核心特性......</p>
<p dir="auto"><s>如果你了解过rustlings这个项目, 那么你可以认为这是C++版本的 -- cpplings</s></p>
<p dir="auto">下面就从项目目标、内容、自动化工具、练习代码检测示例等角度详细介绍一下这个项目....</p>
<p dir="auto"><img src="/assets/uploads/files/1750257461609-68c27d22-51e4-4989-a1b1-b8bd5e847f05-image.png" alt="68c27d22-51e4-4989-a1b1-b8bd5e847f05-image.png" class=" img-fluid img-markdown" /></p>
<hr />
<h2>0.目标</h2>
<ul>
<li><strong>1.</strong> 任何人都可以在网上<strong>免费获取</strong>课程资源</li>
<li><strong>2.</strong> 强调通过<strong>动手实践/代码练习</strong>的方式来学习</li>
<li><strong>3.</strong> 提供<strong>自动化的代码练习 + 方便的环境搭建</strong>的工具支持</li>
<li><strong>4.</strong> 通过社区共享、共建、互助实现良性循环 - <strong>开源 + 论坛</strong></li>
</ul>
<h2>1.这里的"现代C++"指的是什么?</h2>
<p dir="auto">这里指的是狭义上的现代C++, 即C++11及之后的核心标准特性的集合</p>
<p dir="auto"><img src="/assets/uploads/files/1750258854012-865f7495-62dc-4a8b-bd02-44fdc67ceaf3-image.png" alt="865f7495-62dc-4a8b-bd02-44fdc67ceaf3-image.png" class=" img-fluid img-markdown" /></p>
<h2>2.项目内容结构</h2>
<ul>
<li><strong>练习代码(核心):</strong> 每个核心特性都会制作1个或多个对应的练习代码, 并由<a href="https://github.com/d2learn/xlings" rel="nofollow ugc">xlings工具</a>提供自动化检测和环境支持</li>
<li><strong>视频:</strong> 每个代码练习也会提供对应的视频讲解和代码示例的演示</li>
<li><strong>社区支持:</strong> 提供一个专属教程的论坛版块, 用于分享代码和交流讨论</li>
<li><strong>文档:</strong> 每个练习中有对应的cpprefrence参考链接, 当做练习遇到困难时可以查询</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1750259131562-4a1d4561-7861-49f1-8ce9-eab83e68a2d6-image.png" alt="4a1d4561-7861-49f1-8ce9-eab83e68a2d6-image.png" class=" img-fluid img-markdown" /></p>
<h2>3.一键式的练习代码环境搭建</h2>
<p dir="auto">通过一行<code>xlings install mcpp-standard</code>命令即可获取项目代码, 并且自动检测本地环境和配置依赖</p>
<p dir="auto"><img src="/assets/uploads/files/1750259875610-c8af6168-c5a6-42c9-b66d-ff16d0711aa4-image.png" alt="c8af6168-c5a6-42c9-b66d-ff16d0711aa4-image.png" class=" img-fluid img-markdown" /></p>
<h2>4.自动化检测程序简介 - 实时代码检测 + 信息提示 + 练习文件自动跳转</h2>
<p dir="auto">使用<code>xlings checker</code>进入自动化代码练习环境后, 工具会自动定位打开对应的练习代码文件, 并在控制台输出提示编译器的错误及提示信息。一般检测程序分两个检测阶段: 第一个是编译期检测, 即你需要通过练习代码中的提示信息和控制台编译器的报错, 修复代码的编译错误; 第二个是运行时检测, 即当前代码运行时是否能通过所有检查点。当修复编译错误并通过所有检查点时, 控制台就会显示当前练习通过并提示你进入下一个练习</p>
<p dir="auto"><strong>代码练习文件示例</strong></p>
<pre><code class="language-cpp">// mcpp-standard: https://github.com/Sunrisepeak/mcpp-standard
// license: Apache-2.0
// file: dslings/hello-mcpp.cpp
//
// Exercise/练习: 自动化代码练习使用教学
//
// Tips/提示:
//    该项目是使用xlings工具搭建的自动化代码练习项目, 通过在项目根目录下
//    执行 xlings checker 进入"编译器驱动开发模式"的练习代码自动检测.
//    你需要根据控制台的报错和提示信息, 修改代码中的错误. 当修复所有编译错误和
//    运行时检查点后, 你可以删除或注释掉代码中的 D2X_WAIT 宏, 会自动进入下一个练习.
//
//      - D2X_WAIT: 该宏用于隔离不同练习, 你可以删除或注释掉该宏, 进入下一个练习.
//      - d2x_assert_eq: 该宏用于运行时检查点, 你需要修复代码中的错误, 使得所有
//      - D2X_YOUR_ANSWER: 该宏用于提示你需要修改的代码, 一般用于代码填空(即用正确的代码替换这个宏)
//
// Auto-Checker/自动检测命令:
//
//   d2x checker hello-mcpp
//

#include &lt;d2x/common.hpp&gt;

// 修改代码时可以观察到控制台"实时"的变化

int main() {

    std::cout &lt;&lt; "hello, mcpp!" &lt;&lt; std:endl; // 0.修复这个编译错误

    int a = 1.1; // 1.修复这个运行时错误, 修改int为double, 通过检查

    d2x_assert_eq(a, 1.1); // 2.运行时检查点, 需要修复代码通过所有检查点(不能直接删除检查点代码)

    D2X_YOUR_ANSWER b = a; // 3.修复这个编译错误, 给b一个合适的类型

    d2x_assert_eq(b, 1); // 4.运行时检查点2

    D2X_WAIT // 5.删除或注释掉这个宏, 进入下一个练习(项目正式代码练习)

    return 0;
}
</code></pre>
<p dir="auto"><strong>控制台输出及解释</strong></p>
<pre><code class="language-bash">🌏Progress: [&gt;----------] 0/10 --&gt;&gt; 显示当前的练习进度

[Target: 00-0-hello-mcpp] - normal --&gt;&gt; 当前的练习名

❌ Error: Compilation/Running failed for dslings/hello-mcpp.cpp --&gt;&gt; 显示检测状态

 The code exist some error!

---------C-Output--------- - 编译器输出信息
[HONLY LOGW]: main: dslings/hello-mcpp.cpp:24 - ❌ | a == 1.1 (1 == 1.100000) --&gt;&gt; 错误提示及位置(24行)
[HONLY LOGW]: main: dslings/hello-mcpp.cpp:26 - 🥳 Delete the D2X_WAIT to continue...


AI-Tips-Config: https://d2learn.org/docs/xlings --&gt;&gt; AI提示(需要配置大模型的key, 可不使用)

---------E-Files---------
dslings/hello-mcpp.cpp --&gt;&gt; 当前检测的文件
-------------------------

Homepage: https://github.com/d2learn/xlings
</code></pre>
<p dir="auto"><strong>自动检测程序和练习状态对比</strong></p>
<p dir="auto"><img src="/assets/uploads/files/1750261349311-946943bd-141b-4271-861c-27f06ce0780e-image.png" alt="946943bd-141b-4271-861c-27f06ce0780e-image.png" class=" img-fluid img-markdown" /></p>
<h2>5.C++特性和视频/代码列表</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>c++标准</th>
<th>特性</th>
<th>标题</th>
<th>练习代码/视频</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>项目介绍</strong></td>
<td><code>动手学</code></td>
<td>现代C++核心语言特性练习</td>
<td><a href="https://www.bilibili.com/video/BV182MtzPEiX" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>项目使用教程/引导</code></td>
<td>hello mcpp</td>
<td><a href="dslings/hello-mcpp.cpp">code</a> / <a href="https://www.bilibili.com/video/BV182MtzPEiX?p=2" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td><strong>cpp11</strong></td>
<td><code>00 - auto和decltype</code></td>
<td>类型推导</td>
<td><a href="dslings/cpp11/00-auto-and-decltype-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1xkdYYUEyH" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>decltype注意事项</td>
<td><a href="dslings/cpp11/00-auto-and-decltype-4.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1KWoMYUEzW" rel="nofollow ugc">video</a></td>
<td><a href="https://forum.d2learn.org/topic/82" rel="nofollow ugc">补充</a></td>
</tr>
<tr>
<td></td>
<td><code>01 - default和delete</code></td>
<td>控制默认构造函数生成</td>
<td><a href="dslings/cpp11/01-default-and-delete-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1B35pz5EN2" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>类型对象行为控制示例</td>
<td><a href="dslings/cpp11/01-default-and-delete-1.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1Vg5tznE8o" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>02 - override和final</code></td>
<td>重写显示意图和编译器检查</td>
<td><a href="dslings/cpp11/02-final-and-override-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1BdLJz6EKJ" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>继承和重现限制</td>
<td><a href="dslings/cpp11/02-final-and-override-1.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1H1jAzTEYT" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>03 - 后置返回值类型</code></td>
<td>后置返回值类型基础用法</td>
<td><a href="dslings/cpp11/03-trailing-return-type.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1Ma5wzgE9h" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>04 - 右值引用</code></td>
<td>右值引用与临时对象生命周期延长的可变性质</td>
<td><a href="dslings/cpp11/04-rvalue-references.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1vn5wzmEVk" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>05 - 移动语义</code></td>
<td>移动构造和触发时机</td>
<td><a href="dslings/cpp11/05-move-semantics-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV19gj9zAERL" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>移动赋值和触发时机</td>
<td><a href="dslings/cpp11/05-move-semantics-1.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1NDjRzREsY" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>移动的不是对象而是资源</td>
<td><a href="dslings/cpp11/05-move-semantics-2.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1P9jRzXE3a" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>06 - 作用域枚举</code></td>
<td>传统枚举的问题</td>
<td><a href="dslings/cpp11/06-scoped-enums-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1fn7iz4EuR" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>作用域枚举的基本用法</td>
<td><a href="dslings/cpp11/06-scoped-enums-1.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1fn7iz4EuR" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td><code>07 - constexpr</code></td>
<td>const和constexpr有什么不同</td>
<td><a href="dslings/cpp11/07-constexpr-0.cpp">code</a> / <a href="https://www.bilibili.com/video/BV1LRMLzgE4w" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>编译期计算应用示例</td>
<td><a href="dslings/cpp11/07-constexpr-1.cpp">code</a> / <a href="https://www.bilibili.com/video/BV15CMEzLEuN" rel="nofollow ugc">video</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td>...</td>
<td>...</td>
<td>...</td>
<td></td>
</tr>
</tbody>
</table>
<h2>6.社区 | 交流</h2>
<ul>
<li><strong>即时交流(Q群):</strong> 167535744</li>
<li><strong>练习代码/技术交流&amp;讨论:</strong> <a href="https://forum.d2learn.org/category/20" rel="nofollow ugc">论坛版块</a></li>
</ul>
<h2>7.Other</h2>
<ul>
<li><strong>项目地址:</strong> <a href="https://github.com/Sunrisepeak/mcpp-standard" rel="nofollow ugc">https://github.com/Sunrisepeak/mcpp-standard</a></li>
<li><strong>工具地址:</strong> <a href="https://github.com/d2learn/xlings" rel="nofollow ugc">https://github.com/d2learn/xlings</a></li>
</ul>
]]></description><link>http://forum.d2learn.org/topic/95/开源-动手学现代cpp核心特性-像打游戏一样学习c</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 04:09:40 GMT</lastBuildDate><atom:link href="http://forum.d2learn.org/topic/95.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jun 2025 15:33:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot; on Sat, 21 Jun 2025 07:15:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="http://forum.d2learn.org/uid/84">@ziyikong</a> 今天或明天我也会再制作一个windows上练习代码环境搭建的视频细节</p>
]]></description><link>http://forum.d2learn.org/post/414</link><guid isPermaLink="true">http://forum.d2learn.org/post/414</guid><dc:creator><![CDATA[SPeak]]></dc:creator><pubDate>Sat, 21 Jun 2025 07:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to 【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot; on Sat, 21 Jun 2025 07:13:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="http://forum.d2learn.org/uid/84">@ziyikong</a> 可以创建发一个新贴, 详细描述一下问题 环境/系统版本、报错log、xlings是否可用及版本号, 以及复现步骤...</p>
]]></description><link>http://forum.d2learn.org/post/413</link><guid isPermaLink="true">http://forum.d2learn.org/post/413</guid><dc:creator><![CDATA[SPeak]]></dc:creator><pubDate>Sat, 21 Jun 2025 07:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to 【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot; on Sat, 21 Jun 2025 03:35:25 GMT]]></title><description><![CDATA[<p dir="auto">第一个所有bug解决完后出现的</p>
]]></description><link>http://forum.d2learn.org/post/412</link><guid isPermaLink="true">http://forum.d2learn.org/post/412</guid><dc:creator><![CDATA[ziyikong]]></dc:creator><pubDate>Sat, 21 Jun 2025 03:35:25 GMT</pubDate></item><item><title><![CDATA[Reply to 【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot; on Sat, 21 Jun 2025 03:17:50 GMT]]></title><description><![CDATA[<p dir="auto">这是怎么了</p>
]]></description><link>http://forum.d2learn.org/post/411</link><guid isPermaLink="true">http://forum.d2learn.org/post/411</guid><dc:creator><![CDATA[ziyikong]]></dc:creator><pubDate>Sat, 21 Jun 2025 03:17:50 GMT</pubDate></item><item><title><![CDATA[Reply to 【开源】动手学现代Cpp核心特性 - &quot;像打游戏一样学习C++&quot; on Sat, 21 Jun 2025 03:17:34 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1750475849517-05144c59-19b1-4b50-ada4-9f497543e5a9-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.d2learn.org/post/410</link><guid isPermaLink="true">http://forum.d2learn.org/post/410</guid><dc:creator><![CDATA[ziyikong]]></dc:creator><pubDate>Sat, 21 Jun 2025 03:17:34 GMT</pubDate></item></channel></rss>