meousker77 / cpp17 Goto Github PK
View Code? Open in Web Editor NEW本书为《C++17 the complete guide》的个人中文翻译,仅供学习和交流使用,侵删
本书为《C++17 the complete guide》的个人中文翻译,仅供学习和交流使用,侵删
文件已損壞,望修復
latex 版,78 页第 4 段
“有了推导指引饮后”
由于作者编写本书的方式是持续更新的,网上的pdf版本都是更新到 2019.2的,而本书完结于 2020.9,长达一年半时间应该加了一些东西,不知道这里的翻译是否包含这些呢?
page 92
编译期 if 影响返回值类型:
else [
--> else {
page 106
sturct CustomerHash
--> struct CustomerHash
感谢你的翻译,学到了很多
似乎这个理论有问题,实际测试:
auto eval = [](auto fun)
{
const auto t1 = std::chrono::high_resolution_clock::now();
const auto [name, result] = fun();
const auto t2 = std::chrono::high_resolution_clock::now();
const std::chrono::duration<double, std::milli> ms = t2 - t1;
std::cout << std::setw(28) << std::left << name << "sum: "
<< result << "\t time: " << ms.count() << " ms\n";
};
{
eval([&v] { return std::pair{ "std::count_if (seq, long)",
std::count_if(SEQ
v.begin(), v.end(),
[](int elem) {
return elem % 2 == 0;
}) }; });
eval([&v] { return std::pair{ "std::count_if (par, long)",
std::count_if(PAR
v.begin(), v.end(),
[](int elem) {
return elem % 2 == 0;
}) }; });
VS2022 C++17 release编译运行结果
std::count_if (seq, long) sum: 100,000,007 time: 51.5 ms
std::count_if (par, long) sum: 100,000,007 time: 13.3 ms
在 9.1 编译期if语句产生的原因 有个小错误,可能是打字笔误:
应该是:
if (std::is_same_v<T, std::string>) {
return x;
}
很高兴看到这本书的中文翻译,自己也是C++爱好者,也有翻译过关于现代C++的书籍。
不过,我的翻译大多是使用markdown的方式。
这里想求教,是否能分享一下您学习Latex的网站地址,或者是书籍名称?想参考学习一下。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.