命名空间
变体
操作

std::constructible_from

来自 cppreference.cn
 
 
 
定义于头文件 <concepts>
template< class T, class... Args >

concept constructible_from =

    std::destructible<T> && std::is_constructible_v<T, Args...>;
(C++20 起)

constructible_from 概念指定类型 T 的变量可以用给定的一组参数类型 Args... 初始化。

[编辑] 参考

  • C++23 标准 (ISO/IEC 14882:2024)
  • 18.4.11 概念 constructible_from [concept.constructible]
  • C++20 标准 (ISO/IEC 14882:2020)
  • 18.4.11 概念 constructible_from [concept.constructible]

[编辑] 参阅

检查类型是否具有针对特定参数的构造函数
(类模板) [编辑]