How does the C++17 proposal for uniform call syntax intend to handle namespaces?

百般思念 提交于 2019-12-04 10:31:12

问题


As far as I know, there are two propsals for uniform call syntax for C++17 (where the other one is called unified call syntax).

Reading them, I cant see how they intend to handle namespaces.

Example:

class Class {...}
namespace MyNamespace {
  void f(Class x, Class y);
}

Will it be possible to call this method using something like:

Class a, b;
a.MyNamespace::f(b);

Or do both the free function, and the class need to be defined in the same namespace?

References:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4174.pdf

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4165.pdf


回答1:


Update: C++17 does not get unified call syntax at this time. Motion does not pass. #cpp #cpp17

https://twitter.com/ericniebler/status/705855444049399808



来源:https://stackoverflow.com/questions/34376985/how-does-the-c17-proposal-for-uniform-call-syntax-intend-to-handle-namespaces

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