{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

C++编程规范:101条规则、准则与最佳实践

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

C++编程规范:101条规则、准则与最佳实践

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

C++领域20年集大成之作
两位世界专家联袂巨献
适合所有层次C++程序员
良好的编程规范可以改善代码质量,缩短上市时间,提升团队效率,简化维护工作。在本书中,两位全世界受尊敬的C++专家将全球C++社区的集体智慧和经验凝结成一整套编程规范。这些规范可以作为每一个开发团队制定实际开发规范的基础,更是每一位C++程序员应该遵循的行事准则。
本书涵盖了C++程序设计的每一个方面,包括设计和编码风格、函数、操作符、类的设计、继承、构造与析构、赋值、名字空间、模块、模板、泛型、异常、STL容器和算法等。书中对每一条规范都给出了言简意赅的概述,并辅以实例说明;另外还给出了从类型定义到错误处理等方面的大量C++实践,包括许多总结和标准化的技术。即使使用C++多年的程序员也会从中受益匪浅。
通过阅读本书,可以找到以下问题的答案。
哪些东西值得标准化?哪些东西不值得标准化?
使代码可扩展的方法是什么?
合理的错误处理策略有哪些要素?
如何(和为什么要)避免不必要的初始化、循环依赖和定义依赖?
何时应该(以及如何)同时使用静态和动态的多态性;
如何实践“安全的”改写?
何时该提供不会失败的交换?
为什么阻止异常跨越模块边界传播?如何阻止?
为什么不应该在头文件中写名字空间声明或指令?
为什么应该使用STL vector和string代替数组?
如何选择正确的STL搜索或排序算法?
为了保证代码的类型安全,应该遵从哪些规则?
Content Description

在《C++编程规范:101条规则、准则与实践》中,两位知名的C++专家将全球C++界20年的集体智慧和经验凝结成一套编程规范。这些规范可以作为每一个开发团队制定实际开发规范的基础,更是每一位C++程序员应该遵循的行事准则。书中对每一条规范都给出了描述,并辅以实例说明;从类型定义到错误处理,都给出了C++实践,即使使用C++多年的程序员也会从本书中受益匪浅。
《C++编程规范:101条规则、准则与实践》适合于各层次C++程序员使用,也可作为高等院校C++课程的教学参考书。
Author Description

Herb Sutter,是ISO C++标准委员会主席,《C++ Users Journal》杂志特邀编辑和专栏作家。他目前在微软公司领导.NET环境下C++语言扩展的设计工作。

Andrei Alexandrescu,是C++专家,《C++ Users Journal》杂志的专栏作家,他的《Modern C++ Design》一书曾荣获2001年C++图书称号。
Catalogue

组织和策略问题1
第0条不要拘泥于小节(又名:了解哪些东西不应该标准化)2
第1条在高警告级别干净利落地进行编译4
第2条使用自动构建系统7
第3条使用版本控制系统8
第4条做代码审查9设计风格11
第5条一个实体应该只有一个紧凑的职责12
第6条正确、简单和清晰第一13
第7条编程中应知道何时和如何考虑可伸缩性14
第8条不要进行不成熟的优化16
第9条不要进行不成熟的劣化18
第10条尽量减少全局和共享数据19
第11条隐藏信息20
第12条懂得何时和如何进行并发性编程21
第13条确保资源为对象所拥有。使用显式的RAII和智能指针24

编程风格27
第14条宁要编译时和连接时错误,也不要运行时错误28
第15条积极使用const30
第16条避免使用宏32
第17条避免使用“魔数”34
第18条尽可能局部地声明变量35
第19条总是初始化变量36
第20条避免函数过长,避免嵌套过深38
第21条避免跨编译单元的初始化依赖39
第22条尽量减少定义性依赖。避免循环依赖40
第23条头文件应该自给自足42
第24条总是编写内部#include保护符,决不要编写外部#include保护符43

函数与操作符45
第25条正确地选择通过值、(智能)指针或者引用传递参数46
第26条保持重载操作符的自然语义47
第27条优先使用算术操作符和赋值操作符的标准形式48
第28条优先使用++和--的标准形式。优先调用前缀形式50
第29条考虑重载以避免隐含类型转换51
第30条避免重载&&、||或,(逗号)52
第31条不要编写依赖于函数参数求值顺序的代码54

类的设计与继承55
第32条弄清所要编写的是哪种类56
第33条用小类代替巨类57
第34条用组合代替继承58
第35条避免从并非要设计成基类的类中继承60
第36条优先提供抽象接口62
第37条公用继承即可替换性。继承,不是为了重用,而是为了被重用64
第38条实施安全的覆盖66
第39条考虑将虚拟函数声明为非公用的,将公用函数声明为非虚拟的68
第40条要避免提供隐式转换70
第41条将数据成员设为私有的,无行为的聚集(C语言形式的struct)除外72
第42条不要公开内部数据74
第43条明智地使用Pimpl76
第44条优先编写非成员非友元函数79
第45条总是一起提供new和delete80
第46条如果提供类专门的new,应该提供所有标准形式(普通、就地和不抛出)82

构造、析构与复制85
第47条以同样的顺序定义和初始化成员变量86
第48条在构造函数中用初始化代替赋值87
第49条避免在构造函数和析构函数中调用虚拟函数88
第50条将基类析构函数设为公用且虚拟的,或者保护且非虚拟的90
第51条析构函数、释放和交换绝对不能失败92
第52条一致地进行复制和销毁94
第53条显式地启用或者禁止复制95
第54条避免切片。在基类中考虑用克隆代替复制96
第55条使用赋值的标准形式99
第56条只要可行,就提供不会失败的swap(而且要正确地提供)100

名字空间与模块103
第57条将类型及其非成员函数接口置于同一名字空间中104
第58条应该将类型和函数分别置于不同的名字空间中,除非有意想让它们一起工作106
第59条不要在头文件中或者#include之前编写名字空间using108
第60条要避免在不同的模块中分配和释放内存111
第61条不要在头文件中定义具有链接的实体112
第62条不要允许异常跨越模块边界传播114
第63条在模块的接口中使用具有良好可移植性的类型116

模板与泛型119
第64条理智地结合静态多态性和动态多态性120
第65条有意地进行显式自定义122
第66条不要特化函数模板126
第67条不要无意地编写不通用的代码128

错误处理与异常129
第68条广泛地使用断言记录内部假设和不变式130
第69条建立合理的错误处理策略,并严格遵守132
第70条区别错误与非错误134
第71条设计和编写错误安全代码137
第72条优先使用异常报告错误140
第73条通过值抛出,通过引用捕获144
第74条正确地报告、处理和转换错误145
第75条避免使用异常规范146

STL:容器149
第76条默认时使用vector。否则,选择其他合适的容器150
第77条用vector和string代替数组152
第78条使用vector(和string::c_str)与非C++ API交换数据153
第79条在容器中只存储值和智能指针154
第80条用push_back代替其他扩展序列的方式155
第81条多用范围操作,少用单元素操作156
第82条使用公认的惯用法真正地压缩容量,真正地删除元素157

STL:算法159
第83条使用带检查的STL实现160
第84条用算法调用代替手工编写的循环162
第85条使用正确的STL查找算法165
第86条使用正确的STL排序算法166
第87条使谓词成为纯函数168
第88条算法和比较器的参数应多用函数对象少用函数170
第89条正确编写函数对象172

类型安全173
第90条避免使用类型分支,多使用多态174
第91条依赖类型,而非其表示方式176
第92条避免使用reinterpret_cast177
第93条避免对指针使用static_cast178
第94条避免强制转换const179
第95条不要使用C风格的强制转换180
第96条不要对非POD进行memcpy操作或者memcmp操作182
第97条不要使用联合重新解释表示方式183
第98条不要使用可变长参数(...)184
第99条不要使用失效对象。不要使用不安全函数185
第100条不要多态地处理数组186

参考文献187
摘要汇总193
索引205

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book