开发者

Which programming languages, other than C++, support operator overloading? [closed]

开发者 https://www.devze.com 2022-12-30 16:32 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_如何学JAVA
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_如何学JAVA

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 2 years ago.

Improve this question

I know C++.

Anything other?


I'm amused thinking about it. Any C compiler for example, must tell between an int *c; and double d = (int) f * (float) g;. In the former case, * indicates c is a pointer to int while in the latter case it is a multiplication operator. Though not exported outside the compiler itself, C appears to have operator overloading feature. C++ exported it outside the compiler?

I am sure other languages like Java should have some mechanism to tell + or * or such operators when they are used between various combinations and permutations of the types of the operands.

0

精彩评论

暂无评论...
验证码 换一张
取 消