std:: nontype, std:: nontype_t
From cppreference.net
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Function objects
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定義先ヘッダ
<utility>
|
||
|
template
<
auto
V
>
struct nontype_t { explicit nontype_t ( ) = default ; } ; |
(1) | (C++26以降) |
|
template
<
auto
V
>
constexpr std :: nontype_t < V > nontype { } ; |
(2) | (C++26以降) |
1)
クラステンプレート
std::nontype_t
は、コンストラクタのパラメータリストで意図したタグをマッチさせるために使用できます。
2)
対応する
std::nontype
インスタンス
(1)
は、曖昧性除去引数タグであり、
std::
function_ref
のコンストラクタに渡して、包含オブジェクトが定数テンプレートパラメータ
V
の値で構築されるべきであることを示すために使用できます。
テンプレートパラメータ
| V | - | 構造体型の 定数テンプレートパラメータ 。 |
関連項目
|
(C++26)
|
任意の呼び出し可能オブジェクトの非所有ラッパー
(クラステンプレート) |