为什么 c++ 中没有多方法?
我读了很多关于如何在 C++ 中实现多方法的文章:
- http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1529.html
- http://www.codeproject.com/KB/recipes/mmcppfcs.aspx
- http://lambda-the-ultimate.org/node/2590
- http://parasol.tamu.edu/people/peterp/omm/
为什么c++中没有multimethod?
为什么他们没有得到 C++ 标准的支持?
I read many article about how to implement multimethod in c++:
- http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1529.html
- http://www.codeproject.com/KB/recipes/mmcppfcs.aspx
- http://lambda-the-ultimate.org/node/2590
- http://parasol.tamu.edu/people/peterp/omm/
why there are no multimethod in c++?
why do not they get supported by c++ standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
直接从马嘴里说出来:
Bjarne Stroustrup,C++ 的设计与演变 (p297)
以及后来的内容:
(p298f)
一般来说,每当您迫切想知道为什么某些特定的 C++ 功能被实现、未实现或以现在的方式实现,并且如果该功能早于标准化,您就需要阅读 D& ;E.
Straight from the horse's mouth:
Bjarne Stroustrup, The Design and Evolution of C++ (p297)
And later:
(p298f)
In general, whenever you feel the urge to know why some particular C++ feature was implemented, or was not implemented, or was implemented the way it is now, and if that feature pre-dates the standardization, you want to read D&E.
正如 Bjarne 多次指出的那样,当人们批评 C++ 时,通常会这样说:“C++ 太大了,太复杂了,有太多功能,而且太难学了——你应该真正努力让它变得更好。”哦,当你在努力的时候,我也有一个非常好的主意,你应该添加一个杀手级功能!”
As Bjarne has pointed out a number of times, when people criticize C++, it usually runs something like: "C++ is too big, too complex, has too many features, and it's too hard to learn -- you should really work at making it smaller and simpler. Oh, and while you're working on that I also have this really great idea for a killer feature that you should add!"
仅仅因为它可以完成并不意味着它没有完成就是一个问题。对 C++ 的一种批评是“Stroustrup 吸收了任何人都听说过的一切,并试图将其包括在内”。
另外,正如 Raymond Chen 所说,“每个功能都以 -100 分开始。”也就是说,在你问为什么C++没有这些东西之前,你应该详细解释为什么它需要它们。否则,由于与之相关的成本,您的功能将处于负值区域。
Just because it could be done doesn't mean it's a problem that it wasn't done. One criticism of C++ is along the lines of "Stroustrup took everything anyone had heard of, and tried to include it."
Plus, as Raymond Chen says, "Every feature starts off with -100 points." That is, before you ask why C++ doesn't have these things, you should explain in detail why it needs them. Otherwise your feature stays in negative territory, due to the costs associated with it.