c++ - 为什么默认情况下不是字符串文字 constexpr ?
问题描述
为什么我们不制作所有字符串文字constexpr
?
constexpr char name[] = "hello";
template < const char* N >
struct T{};
T < name > t;// this works fine
T < "hello" > t1; // this doesn't work
解决方案
推荐阅读
- c++ - 即使在 MV C++ Redistributable repair 之后,是否有修复“MSVCP100D.dll was not found”的错误?
- python - 服务器响应时间比预期长得多
- r - R中的二尾和一尾T检验
- python - Pandas - 通过 csv 重复行
- sql - 如何使用 executeQueryWithParameters 和 SQLBuilderSelectExpression 在 Microsoft Dynamics 中加入 x++/sql 语句?
- azure-devops - Azure Dev Ops 替换功能在 \\ 上不起作用
- html - 如何将链接内的文本对齐到底角?
- python - 如何对多个数据框python使用条件if/else
- azure - Azure DevOps - Azure 应用服务部署 - 添加应用程序设置 WEBSITE_RUN_FROM_PACKAGE 导致 CSS 无法加载
- python - 无法使用 heroku local 将 Django 应用程序部署到 heroku