Skip to Content
Effective Modern C++(中文版)
book

Effective Modern C++(中文版)

by Scott Meyers
April 2018
Intermediate to advanced
303 pages
4h 54m
Chinese
China Electric Power Press Ltd.
Content preview from Effective Modern C++(中文版)
112
3
编译器会始终生成
Widget
的复制和移动操作(假定支配其生成的条件都得到了满足),
即使这些模板的具现结果生成了复制构造函数或复制赋值运算符的签名(当
T
的值为
Widget
时就会发生这种情况)。十有八九,你会觉得我在螺蛳壳里做道场。但是我之
所以要提起这个自然是有理由的。条款
26
会告诉你,这么一个边缘场景有着至关重
要的推论。
要点速记
特种成员函数是指那些
C++
会自行生成的成员函数:默认构造函数、析构
函数、复制操作,以及移动操作。
移动操作仅当类中未包含用户显式声明的复制操作、移动操作和析构函数
时才生成。
复制构造函数仅当类中不包含用户显式声明的复制构造函数时才生成,如
果该类声明了移动操作则复制构造函数将被删除。复制赋值运算符仅当类
中不包含用户显式声明的复制赋值运算符才生成,如果该类声明了移动操
作则复制赋值运算符将被删除。在已经存在显式声明的析构函数的条件下,
生成复制操作已经成为了被废弃的行为。
成员函数模板在任何情况下都不会抑制特种成员函数的生成。
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

C++程序设计:原理与实践(基础篇)(原书第2版)

C++程序设计:原理与实践(基础篇)(原书第2版)

本贾尼 斯特劳斯特鲁普
C++语言导学(原书第2版)

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

本贾尼 斯特劳斯特鲁普
Go语言编程

Go语言编程

威廉·肯尼迪

Publisher Resources

ISBN: 9787519817749