Skip to Content
C++语言导学(原书第2版)
book

C++语言导学(原书第2版)

by 本贾尼 斯特劳斯特鲁普
August 2021
Intermediate to advanced
450 pages
5h 35m
Chinese
Pearson
Content preview from C++语言导学(原书第2版)

16.2.1 C++11语言特性

查看语言特性列表很容易让人感到困惑。你需要记住的是,语言特性不是单独使用的。特别是,大多数C++11新特性如果离开了旧特性提供的框架都毫无意义。

[1] 用{}列表进行统一、通用的初始化(参见1.4节、4.2.3节)

[2] 从初始值进行类型推断:auto(参见1.4节)

[3] 防止类型窄化(参见1.4节)

[4] 泛化的、有保证的常量表达式:constexpr(参见1.6节)

[5] 范围for语句(参见1.7节)

[6] 空指针关键字:nullptr(参见1.7节)

[7] 有作用域的且强类型的enum:enum class(参见2.5节)

[8] 编译时断言:static_assert(参见3.5.5节)

[9] {}列表到std::initializer_list的语言层的映射(参见4.2.3节)

[10] 右值引用,移动语义使能(参见5.5.2节)

[11] 以>>(两个>之间没有空格)结束的嵌套模板参数

[12] lambda(参见6.3.2节)

[13] 可变参数模板(参见7.4节)

[14] 类型和模板别名(参见6.4.2节)

[15] 万国码字符

[16] long long整数类型

[17] 对齐控制:alignas和alignof

[18] 在声明中将一个表达式的类型作为类型使用的能力:decltype

[19] 裸字符串字面值(参见9.4节)

[20] 泛化的POD(Plain Old Data,简单旧数据)

[21] 泛化的union

[22] 局部类作为模板参数

[23] 后缀返回类型语法

[24] 一种属性语法和两种标准属性:[[carries_dependency]]和[[noreturn]]

[25] 防止异常传播:noexcept说明符(参见3.5.1节) ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787111633280