22<feed xmlns =" http://www.w3.org/2005/Atom" >
33 <title >cpprefjp - C++日本語リファレンス</title >
44 <link href =" https://cpprefjp.github.io" />
5- <updated >2026-09-24T18:34:29.333174 </updated >
6- <id >3fdbe057-b464-41e6-88ac-40bc1561f940 </id >
5+ <updated >2026-09-25T13:10:18.228310 </updated >
6+ <id >e3d7acbc-8f20-45a2-85ea-fc84b56e1815 </id >
77
88
9+ <entry >
10+ <title >pointer_tag_pair -- pointer_tag_pair : 応用事例を記載</title >
11+ <link href =" https://cpprefjp.github.io/reference/memory/pointer_tag_pair.html" />
12+ <id >a3828624ef73f273f917ea7a59a0ba88ba1f8222:reference/memory/pointer_tag_pair.md</id >
13+ <updated >2026-09-25T22:08:17+09:00</updated >
14+
15+ <summary type =" html" >< pre>< code> diff --git a/reference/memory/pointer_tag_pair.md b/reference/memory/pointer_tag_pair.md
16+ index f2e97a387..e8f2b5918 100644
17+ --- a/reference/memory/pointer_tag_pair.md
18+ +++ b/reference/memory/pointer_tag_pair.md
19+ @@ -76,6 +76,21 @@ namespace std {
20+
21+ また、コンストラクタなどの制約には説明専用コンセプト[`tagging-compatible-pointee`](tagging-compatible-pointee.md)を使用する。
22+
23+ +## 備考
24+ +### 応用事例
25+ +ポインタタギングは広く使われている手法である。代表的な応用例を以下に挙げる。
26+ +
27+ +- LLVMは`PointerIntPair`と`PointerUnion`として同種のクラスを提供している。本クラスと同じく、指す先のアライメントから使えるビット数を求め、下位ビットへ小さな整数値や型の判別情報を格納する
28+ + - [The PointerIntPair class - LLVM Programmer& #39;s Manual](https://llvm.org/docs/ProgrammersManual.html#the-pointerintpair-class)
29+ +- CPythonのガベージコレクタは、収集対象のオブジェクトをつなぐ双方向リストのポインタにフラグを埋め込む。`_gc_prev`の下位2ビットに「収集中か」と「ファイナライズ済みか」を格納し、収集の最中は`_gc_next`の最下位ビットに「到達不能と暫定判定されたか」を格納する。オブジェクト1個あたりの追加メモリを増やさずにフラグを持たせるための最適化である
30+ + - [Garbage collector design - CPython Internals Docs](https://github.com/python/cpython/blob/main/InternalDocs/garbage_collector.md)
31+ +- [`std::atomic`](/reference/atomic/atomic.md)`& lt;`[`std::shared_ptr`](shared_ptr.md)`& lt;T& gt;& gt;`のlibstdc++とMSVCの実装は、制御ブロックへのポインタの最下位ビットをスピンロックのフラグに使用する。指す先のオブジェクトへのポインタではなく制御ブロックへのポインタを選ぶのは、制御ブロックの確保をライブラリ側が行うためアライメントを保証できるからである
32+ + - [Inside STL: The atomic shared_ptr - The Old New Thing](https://devblogs.microsoft.com/oldnewthing/20241219-00/?p=110663)
33+ +- レイトレーシングのpbrtは、形状やマテリアルなど多数の型を仮想関数なしで扱うために`TaggedPointer`を使う。こちらは下位ビットではなく上位7ビット (ビット57以上) に型の番号を格納し、128種類までの型を判別して、型に応じた処理を呼び分ける
34+ + - [B.4.4 Tagged Pointers - Physically Based Rendering](https://pbr-book.org/4ed/Utilities/Containers_and_Memory_Management)
35+ +
36+ +pbrtのように上位ビットを使う方法は、アドレス空間が64ビット全体を使わないことに依存するため、対象とする環境を限定する。上位ビットを無視するハードウェア機構としては、IntelのLAM (linear address masking)、AMDのUAI (upper address ignore)、ARMのTBI (top byte ignore) などがある。
37+ +
38+
39+ ## メンバ関数
40+ ### 構築・破棄
41+ < /code>< /pre> </summary >
42+
43+ <author >
44+ <name >Akira Takahashi</name >
45+ <email >faithandbrave@gmail.com</email >
46+ </author >
47+ </entry >
48+
949 <entry >
1050 <title >機能テストマクロ -- is_within_lifetime : Clangで実装された</title >
1151 <link href =" https://cpprefjp.github.io/lang/cpp26/feature_test_macros.html" />
@@ -1223,36 +1263,4 @@ index 713856be2..79971f459 100644
12231263 </author >
12241264 </entry >
12251265
1226- <entry >
1227- <title >what -- exception::what : 基底クラスの宣言にoverrideが付いており、存在しないC++17版が記載されていたのを修正</title >
1228- <link href =" https://cpprefjp.github.io/reference/exception/exception/what.html" />
1229- <id >5113f2599ddf3c03d03f0556cfd6363181fc5595:reference/exception/exception/what.md</id >
1230- <updated >2026-09-23T07:19:44+09:00</updated >
1231-
1232- <summary type =" html" >< pre>< code> diff --git a/reference/exception/exception/what.md b/reference/exception/exception/what.md
1233- index 80402d417..f3fb62475 100644
1234- --- a/reference/exception/exception/what.md
1235- +++ b/reference/exception/exception/what.md
1236- @@ -5,10 +5,9 @@
1237- * function[meta id-type]
1238-
1239- ```cpp
1240- -virtual const char* what() const; // (1) C++98
1241- -virtual const char* what() const noexcept; // (1) C++11
1242- -const char* what() const noexcept override; // (1) C++17
1243- -constexpr const char* what() const noexcept override; // (1) C++26
1244- +virtual const char* what() const; // (1) C++98
1245- +virtual const char* what() const noexcept; // (1) C++11
1246- +constexpr virtual const char* what() const noexcept; // (1) C++26
1247- ```
1248-
1249- ## 概要
1250- < /code>< /pre> </summary >
1251-
1252- <author >
1253- <name >rotarymars</name >
1254- <email >s.goto2050@gmail.com</email >
1255- </author >
1256- </entry >
1257-
12581266</feed >
0 commit comments