为什么C ++不支持命名参数 [英] Why C++ doesn't support named parameter

查看:100
本文介绍了为什么C ++不支持命名参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前,我使用python。在Python中,我将命名参数(关键字参数)用于函数调用。关于命名参数的Wikipedia页面显示C ++不支持它。为什么C ++不支持命名参数?

Previously, I worked with python. In Python I used named parameter(keyword argument) for function calls. Wikipedia page about named parameter tells that C++ doesn't support it. Why C++ doesn't support named parameter?. Does it support in future version of C++ standard?

推荐答案


为什么C ++不支持命名参数?

Why C++ doesn't support named parameter

因为该功能尚未引入标准。该功能在C中也不存在(也不存在),这是C ++最初的基础。

Because such feature has not been introduced to the standard. The feature didn't (and doesn't) exist in C either, which is what C++ was originally based on.


它是否支持在将来的C ++标准版本中?

Does it support in future version of C++ standard?

也许。为此编写了提案。这取决于提案是否被投票纳入标准。

Maybe. A proposal has been written for it. It depends on whether the proposal is voted into the standard.

这篇关于为什么C ++不支持命名参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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