Skip to Content
C++ソフトウェア設計 ―高品質設計の原則とデザインパターン
book

C++ソフトウェア設計 ―高品質設計の原則とデザインパターン

by Klaus Iglberger, 千住 治郎
October 2023
Intermediate to advanced
408 pages
6h 37m
Japanese
O'Reilly Japan, Inc.
Content preview from C++ソフトウェア設計 ―高品質設計の原則とデザインパターン

8章Type Era­sure パターン

ここまで度々述べてきましたが、関心の分離と値セマンティクスは本書の大きな 2 本柱です。本章ではこの 2 つを組み合わせた、Mod­ern C++ の中でもひときわ面白いデザインパターン、Type Era­sure パターンを取り上げます。Type Era­sure パターンは現在も大きく進化を遂げている途上にあるため、細かく、そして深く、すべての面を解説します。設計面に限らず、もちろん実装詳細の具体例も多数取り上げます。

ガイドライン 32」では、Type Era­sure パターンを紹介し、依存関係削減と値セマンティクスの組み合わせが強力である理由を述べます。また、自らが所有する (所有権を持つ) Type Era­sure パターンの基本的実装を全般的に説明します。

ガイドライン 33」は例外的な位置付けです。本書は依存関係と設計を主眼にしていますが、本ガイドラインだけは性能を主眼にした実装詳細を解説します。小さいバッファの最適化 (SBO、Small Buf­fer Op­ti­miza­tion)、および Type Era­sure パターンを高速化する、仮想関数の手動ディスパッチを説明します。

ガイドライン 34」では、所有権を持つ Type Era­sure パターン実装のセットアップコストを掘り下げます。値セマンティクスに付随し発生する、あまり嬉しくないコストが見えるようになります。そのため、敢えて参照セマンティクスの世界へ足を踏み入れ、所有権を持たない Type Era­sure パターンを実装します。

ガイドライン 32:Type Era­sure パターンで継承階層の置換を検討する

本書には、全体を通じ、繰り返し提言していることがあります。 ...

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

データベースリライアビリティエンジニアリング ―回復力のあるデータベースシステムの設計と運用

データベースリライアビリティエンジニアリング ―回復力のあるデータベースシステムの設計と運用

Laine Campbell, Charity Majors, 八木 和生

Publisher Resources

ISBN: 9784814400454Publisher Website