Replies: 4 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. |
Beta Was this translation helpful? Give feedback.
-
@geoffromer thanks, I checked that about other questions? Also about move:
I like destructive move more but Rust have other cons:
|
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions