跳转至

ev-fmt-concepts-formattable-001

字段 值
项目 fmtlib/fmt
固定 commit 1be298e1bd68
路径 include/fmt/base.h
行段 L2738-L2741
特性 concepts 与 requires
许可证 MIT
代码来源 项目源码
级别 manual
审核 zyuhao7 @ 2026-10-24
测试代码 否
发现方式 tree-sitter

用法

用 concept 包装已有的 is_formattable 特征

为什么典型

在保留旧 trait 的同时提供 C++20 约束接口,条件编译隔离版本差异,迁移成本低。

摘录

#if defined(__cpp_concepts) && __cpp_concepts >= 201907L
template <typename T, typename Char = char>
concept formattable = is_formattable<remove_reference_t<T>, Char>::value;
#endif

备注

生产路径;concept 定义位于 C++20 特性检测分支内。

查看固定 commit 源码 · 返回证据索引