-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqueryable.html
More file actions
301 lines (242 loc) · 15.5 KB
/
queryable.html
File metadata and controls
301 lines (242 loc) · 15.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!doctype html>
<html class="cpprefjp" lang="ja" itemscope="" itemtype="http://schema.org/WebPage">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXNBNVBTJS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NXNBNVBTJS');
</script>
<meta charset="UTF-8">
<title>queryable - cpprefjp C++日本語リファレンス</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="keywords" content="
C++,標準ライブラリ,リファレンス,ドキュメント,STL,std,,execution,concept,std,cpp26
">
<meta name="title" content="queryable - cpprefjp C++日本語リファレンス" />
<meta itemprop="name" content="queryable - cpprefjp C++日本語リファレンス" />
<meta property="og:title" content="queryable - cpprefjp C++日本語リファレンス" />
<meta property="og:url" content="https://cpprefjp.github.io/reference/execution/queryable.html" />
<meta property="og:site_name" content="cpprefjp - C++日本語リファレンス" />
<meta property="og:type" content="article" />
<meta property="og:description" content="`queryable`は、型`T`がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="queryable - cpprefjp C++日本語リファレンス" />
<meta name="twitter:url" content="https://cpprefjp.github.io/reference/execution/queryable.html" />
<meta name="twitter:description" content="`queryable`は、型`T`がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="https://cpprefjp.github.io/rss.xml" />
<link rel="apple-touch-icon" sizes="180x180" href="../../static/favicons/apple-touch-icon.png?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95">
<link rel="icon" type="image/png" sizes="32x32" href="../../static/favicons/favicon-32x32.png?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95">
<link rel="icon" type="image/png" sizes="16x16" href="../../static/favicons/favicon-16x16.png?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95">
<link rel="manifest" href="../../manifest.json?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95">
<meta name="theme-color" content="#f5f8fc">
<link rel="stylesheet" href="../../static/pygments/default.css?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95">
<!-- <link rel="stylesheet" href="../../static/css/root.css"> -->
<link href="../../static/kunai/css/kunai-stage-0.css?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95" rel="stylesheet">
<link href="../../static/kunai/css/kunai-stage-1.css?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95" rel="stylesheet">
<link href="../../static/kunai/css/kunai-stage-2.css?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95" rel="stylesheet">
<link href="../../static/kunai/css/kunai-stage-3.css?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95" rel="stylesheet">
<script type="text/javascript" src="../../static/kunai/js/kunai-vendor.js?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95"></script>
<script type="text/javascript" src="../../static/kunai/js/kunai.js?cachebust=be86fa2321ebe02b6955b61b98b778e377bcbf95"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var kn = new Kunai;
kn.cpprefjp();
});
</script>
</head>
<body>
<header data-kunai-mdinfo="{"meta": {"exposition-only": [""], "header": ["execution"], "id-type": ["concept"], "namespace": ["std"], "cpp": ["cpp26"]}, "sources": [], "page_id": ["reference", "execution", "queryable"]}">
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../index.html">
<div class="title-wrapper clearfix">
<div class="title">cpprefjp - C++日本語リファレンス</div>
</div>
</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<div class="google-search">
<script>
(function() {
var cx = '013316413321391058734:ji_u66hl7hq';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<div class="gcse-search"></div>
</div>
</li>
<li>
<a href="https://github.com/cpprefjp/site">GitHub Project</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main id="main" role="main">
<div class="container-fluid">
<div class="row">
<div class="col-sm-9 col-sm-push-3" itemscope itemtype="http://schema.org/Article">
<div class="row">
<div class="col-sm-12 google-search-result">
<gcse:searchresults></gcse:searchresults>
</div>
</div>
<div class="row">
<div class="col-sm-12 content-header">
<ol class="breadcrumb">
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span>
<a href="../../index.html" itemprop="url">
<i class="fa fa-fw fa-home"></i>
</a>
</span>
</li>
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span>
<a href="../../reference.html" itemprop="url">
<span itemprop="name">リファレンス</span>
</a>
</span>
</li>
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span>
<a href="../../reference/execution.html" itemprop="url">
<span itemprop="name">execution</span>
</a>
</span>
</li>
<li class="active" itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<span>
<span itemprop="name">queryable</span>
</span>
</li>
</ol>
<div class="crsearch"></div>
</div>
</div>
<div class="row">
<div class="col-sm-12 edit-button">
<p class="text-right"><small>
最終更新日時(UTC):
<span itemprop="datePublished" content="2026-02-08T09:20:19">
2026年02月08日 09時20分19秒
</span>
<br/>
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">yoh</span>
</span>
が更新
</small></p>
<p class="text-right">
<a class="history" target="_blank" href="https://github.com/cpprefjp/site/commits/master/reference/execution/queryable.md">
<span class="fa fa-fw fa-clock-o fa-flip-horizontal"></span>履歴
</a>
<a class="edit" target="_blank" href="https://github.com/cpprefjp/site/edit/master/reference/execution/queryable.md">
<span class="fa fa-fw fa-pencil"></span>編集
</a>
</p>
</div>
</div>
<div class="row">
<div class="col-sm-12 content-body">
<div class="identifier-type">concept</div><div class="header"><execution></div><h1 class="exposition-only" itemprop="name"><span class="namespace" title="namespace std">std::</span><span class="token">queryable</span><span class="cpp cpp26" title="C++26で追加">(C++26)</span><span class="cpp exposition-only" title="説明専用"></span></h1>
<div itemprop="articleBody"><p><div class="codehilite"><pre><span></span><code><span class="k">template</span><span class="o"><</span><span class="k">class</span><span class="w"> </span><span class="nc">T</span><span class="o">></span>
<span class="k">concept</span><span class="w"> </span><span class="nc">queryable</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n"><a href="../concepts/destructible.html">destructible</a></span><span class="o"><</span><span class="n">T</span><span class="o">></span><span class="p">;</span>
</code></pre></div>
</p>
<h2>概要</h2>
<p><code>queryable</code>は、型<code>T</code>がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。</p>
<h3>クエリ可能オブジェクト(queryable object)</h3>
<p>クエリ可能オブジェクトは、クエリオブジェクトをキーとして対応する値を保持する、読み取り専用のKey/Valueデータ構造とみなせる。</p>
<ul>
<li><code><a href="execution/env.html">execution::env<>{}</a></code> : 空のクエリ可能オブジェクト</li>
<li><code><a href="execution/prop.html">execution::prop(q, v)</a></code> : キー<code>q</code>と対応値<code>v</code>を保持する最小のクエリ可能オブジェクト</li>
<li><code><a href="execution/env.html">execution::env{...}</a></code> : 複数のKey/Valueを保持するクエリ可能オブジェクト</li>
<li><code>queryable</code>コンセプトを満たすユーザ定義クラスのオブジェクト</li>
</ul>
<p>実行制御ライブラリでは、下記のオブジェクトがクエリ可能オブジェクトとされる。</p>
<ul>
<li><a href="execution/sender.html">Sender</a>に関連付けられた属性(attributes)オブジェクト(<code><a href="execution/get_env.html">execution::get_env</a></code>で取得)</li>
<li><a href="execution/receiver.html">Receiver</a>に関連付けられた環境(environment)オブジェクト(<code><a href="execution/get_env.html">execution::get_env</a></code>で取得)</li>
<li><a href="execution/scheduler.html">Scheduler</a>オブジェクト自身</li>
</ul>
<h3>クエリオブジェクト(query object)</h3>
<p>クエリオブジェクトは、クエリ可能オブジェクトに対する問い合わせ(query)を行う<a class="cpprefjp-defined-word" data-desc="プログラム定義型に対するオーバーロードが許されている標準関数名について、中でいい感じにオーバーロード解決して呼び出してくれる関数オブジェクト">カスタマイゼーションポイントオブジェクト</a>である。</p>
<p>説明用のクエリオブジェクト<code>q</code>、クエリ可能オブジェクト<code>env</code>、引数パック<code>args</code>としたとき</p>
<ul>
<li>問い合わせ式<code>q(env, args...)</code>は、<code>void</code>型であってはならない。</li>
<li>問い合わせ式<code>q(env, args...)</code>は、クエリオブジェクトや引数を変更せず、等しさを保持(equality-preserving)する。</li>
<li>式<code>env.query(q, args...)</code>が<a class="cpprefjp-defined-word" data-desc="プログラムが文法規則・診断対象の意味規則・単一定義規則を満たすこと" href="../../implementation-compliance.html#dfn-well-formed">適格</a>であれば、問い合わせ式<code>q(env, args...)</code>と等価である。</li>
</ul>
<h2>モデル</h2>
<p>説明用の<code>env</code>を<code>Env</code>型のオブジェクトとする。
呼び出し可能オブジェクト<code>q</code>と部分式パック<code>args</code>に対して、<code>requires { q(env, args...) }</code>が<code>true</code>であれば、<code>q(env, args...)</code>が<code>q</code>に課されるセマンティック要件を満たす場合に、<code>Env</code>は<code>queryable</code>のモデルである。</p>
<h2>説明専用エンティティ</h2>
<h3>式<code>MAKE-ENV</code></h3>
<p>説明用のクエリオブジェクト<code>q</code>と式<code>v</code>に対して、式<code>MAKE-ENV(q, v)</code>は<code>queryable</code>を満たす型の式<code>env</code>となり、下記を満たす。</p>
<ul>
<li><code>env.query(q)</code>の結果が<code>v</code>と等しい。</li>
<li>明に規定されない限り、<code>env</code>が有効の間は<code>env.query(q)</code>のオブジェクトも有効である。</li>
</ul>
<h3>式<code>JOIN-ENV</code></h3>
<p>説明用のクエリ可能オブジェクト<code>env1</code>, <code>env2</code>、クエリオブジェクト<code>q</code>、パック式<code>as</code>に対して、式<code>JOIN-ENV(env1, env2)</code>は<code>queryable</code>を満たす型の式<code>env3</code>となり、式<code>env3.query(q, as...)</code>は下記と等価である。</p>
<ul>
<li><a class="cpprefjp-defined-word" data-desc="プログラムが文法規則・診断対象の意味規則・単一定義規則を満たすこと" href="../../implementation-compliance.html#dfn-well-formed">適格</a>であるならば、式<code>env1.query(q, as...)</code></li>
<li>そうではなく、<a class="cpprefjp-defined-word" data-desc="プログラムが文法規則・診断対象の意味規則・単一定義規則を満たすこと" href="../../implementation-compliance.html#dfn-well-formed">適格</a>であるならば、式<code>env2.query(q, as...)</code></li>
<li>そうでなければ、式<code>env3.query(q, as...)</code>は<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a></li>
</ul>
<h2>備考</h2>
<p><a href="execution/sender.html">Sender</a>に関連付けられたクエリ可能オブジェクトは「属性(attributes)」と呼ばれるが、実行制御ライブラリの仕様記述では<a href="execution/receiver.html">Receiver</a>の「環境(environment)」と合わせて<code>Env</code>型や識別子名<code>env</code>として包括的に言及される。</p>
<h2>バージョン</h2>
<h3>言語</h3>
<ul>
<li>C++26</li>
</ul>
<h2>関連項目</h2>
<ul>
<li><code><a href="execution/prop.html">execution::prop</a></code></li>
<li><code><a href="execution/env.html">execution::env</a></code></li>
<li><code><a href="execution/get_env.html">execution::get_env</a></code></li>
</ul>
<h2>参照</h2>
<ul>
<li><a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html" target="_blank">P2300R10 <code>std::execution</code></a></li>
</ul></div>
</div>
</div>
</div>
<div id="sidebar" class="col-sm-3 col-sm-pull-9">
</div>
</div>
</div>
</main>
<footer class="footer navbar navbar-default">
<div class="container-fluid">
<p><small>
本サイトの情報は、
<a href="https://creativecommons.org/licenses/by/4.0/deed.ja" rel="nofollow">クリエイティブ・コモンズ 表示 4.0 非移植 ライセンス(CC BY)</a>
の下に提供されています。
</small></p>
</div>
</footer>
</body>
</html>