有关统一调用语法的C ++ 17建议如何处理命名空间? [英] How does the C++17 proposal for uniform call syntax intend to handle namespaces?

查看:83
本文介绍了有关统一调用语法的C ++ 17建议如何处理命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,对于C ++ 17的统一调用语法有两个建议(其中另一个被称为统一调用语法).

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.

示例:

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);

还是free函数和类都需要在同一个命名空间中定义?

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

参考:

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

推荐答案

更新:C ++ 17目前没有 not 获得统一的调用语法.运动无法通过. #cpp#cpp17

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

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

这篇关于有关统一调用语法的C ++ 17建议如何处理命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆