Timeline for Simple modern C++ string class implementation
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 9, 2017 at 21:03 | comment | added | Deduplicator | There's no issue with ownership, the function does not change it. Yes, there is an issue with the callee setting some byte to zero, or a zero to something else, because it's a counted-string / zero-terminated-string chimaera, but that's what contracts are for. It would probably be a good idea to go fully one of the ways... | |
| Sep 9, 2017 at 20:53 | history | edited | KjMag | CC BY-SA 3.0 |
minor interpunction fix.
|
| Sep 9, 2017 at 20:45 | comment | added | KjMag | It violates encapsulation as it exposes the underlying data pointer, leaves the underlying data open to uncontrolled modification and makes it unclear who takes ownership. As for the class invariant, I've realised it's not true thanks to your question. sz can't be invalidated that way. Thanks for this comment. I've updated the answer. | |
| Sep 9, 2017 at 20:43 | history | edited | KjMag | CC BY-SA 3.0 |
Class invariant informtion removed
|
| Sep 9, 2017 at 20:16 | comment | added | Deduplicator |
What class-invariant does getData() violate? And how does it violate encapsulation?
|
|
| Sep 9, 2017 at 18:05 | history | answered | KjMag | CC BY-SA 3.0 |