Can I add a deduction guide to `std` namespace?

十年热恋 提交于 2020-05-29 03:45:26

问题


Suppose I want to make a new deduction guide making the following possible ?

std::string str;
std::basic_string_view sv = str;

Would that be an Ok customization ?


回答1:


[namespace.std]/2.4:

The behavior of a C++ program is undefined if it declares [...] a deduction guide for any standard library class template.



来源:https://stackoverflow.com/questions/58992794/can-i-add-a-deduction-guide-to-std-namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!