命名空间
变体
操作

std::constructible_from

来自 cppreference.cn
< C++‎ | 概念
定义于头文件 <concepts>
template< class T, class... Args >

concept constructible_from =

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

constructible_from 概念指定类型 T 的变量可以使用给定的参数类型集合 Args... 进行初始化。

[编辑] 参考

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

[编辑] 参见

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