-
Notifications
You must be signed in to change notification settings - Fork 1.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions: move, ctors, operator overloading #1685
Comments
Yes, Carbon will support move semantics; see p0257. In particular, we are experimenting with a hybrid of destructive and non-destructive semantics that we are hoping will combine the advantages of both. |
@geoffromer thanks, I checked that about other questions? Also about move:
I like destructive move more but Rust have other cons:
|
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the |
Sorry this fell off folks radar...
We expect to need something analogous to operator overloading to really retain the same kind of expressive library API capabilities as C++ provides, but we're using a pretty fundamentally different approach to get there that we think will address many problems with it. Similarly, we are using a different approach to constructors somewhat fundamentally. Both of these are covered in the design overview.
We're definitely looking at all of these options. We also have some challenging constraints due to interoperating with C++. As mentioned, we have a plan involving a hybrid approach that so far looks promising. I'm going to convert this to a GitHub discussion as this isn't really an issue BTW. We also have an active language questions channel on our Discord. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I think something like move ctor/assign should be in language. Will it be like rust, with destructive move? Or like c++?
I think both approaches have some pros and cons.
Also about constructors and operator overloading, if carbon will be without exceptions looks it looks like a bad idea to have them
So what your thoughts about that?
The text was updated successfully, but these errors were encountered: