命名空间
变体
操作

std::nontype, std::nontype_t

来自 cppreference.cn
< cpp‎ | utility
 
 
 
函数对象
函数调用
(C++17)(C++23)
恒等函数对象
(C++20)
透明运算符包装器
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

旧式绑定器和适配器
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)  
(直到 C++17*)
(直到 C++17*)(直到 C++17*)(直到 C++17*)(直到 C++17*)
(直到 C++20*)
(直到 C++20*)
(直到 C++17*)(直到 C++17*)
(直到 C++17*)(直到 C++17*)

(直到 C++17*)
(直到 C++17*)(直到 C++17*)(直到 C++17*)(直到 C++17*)
(直到 C++20*)
(直到 C++20*)
 
定义于头文件 <utility>
template< auto V >
struct nontype_t { explicit nontype_t() = default; };
(1) (since C++26)
template< auto V >
constexpr std::nontype_t<V> nontype {};
(2) (since C++26)
1) 类模板 std::nontype_t 可用于构造函数的参数列表以匹配预期的标签。
2) 对应的 std::nontype 实例 (1) 是一个消除歧义的参数标签,可以传递给 std::function_ref 的构造函数,以指示应使用非类型模板参数 V 的值构造包含的对象。

[编辑] 模板参数

V - 结构类型的非类型模板参数。

[编辑] 参见

任何可调用对象的非拥有包装器
(类模板) [编辑]