为什么C ++不支持命名参数 [英] Why C++ doesn't support named parameter
问题描述
以前,我使用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屋!