You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/posts/constructor_in_rust/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Primitive types like integers or floats already have a native syntax for constru
27
27
-**Encapsulation** : It's about invariant and control. Deciding what value are valid or what relation the structure should hold. The goal is to avoid any invalid state, typically achieved through data hiding and encapsulation.
28
28
29
29
-**Placement** : In C++, constructors can be used for placement initialization, allowing an object to be constructed at a specific memory location
30
-
(e.g. on the stack or the heap). (Thanks to [Nabushika on reddit](<https://www.reddit.com/r/learnrust/comments/1qinygp/comment/o0w5ehd/>) for clarifying this sentence)
30
+
(e.g. on the stack or the heap) using the placement new operator. (Thanks to [Nabushika on reddit](<https://www.reddit.com/r/learnrust/comments/1qinygp/comment/o0w5ehd/>) for clarifying this sentence)
0 commit comments