libluna: Disable implicit Vector copying #28

Closed
opened 2023-06-09 20:27:31 +00:00 by apio · 0 comments
Owner

I think Vector copying should be handled similarly to String copying, where implicit copies are disabled using String(const String&) = delete; and instead use a special method.

This should be done for two reasons:

  • First, error propagation. Value-based exceptions cannot be propagated through constructors, so special methods are already better for this.
  • If Vector copying uses special methods instead of implicit C++ stuff, we can create two copy variants: shallow_copy() and deep_copy(). shallow_copy() can be good for performance when dealing with POD types (since we can use plain old memcpy), but obviously deep_copy() is necessary for non-POD data (e.g. Strings).

This is just a TODO reminder for now, as I'm working on public API documentation as of right now.

I think Vector copying should be handled similarly to String copying, where implicit copies are disabled using String(const String&) = delete; and instead use a special method. This should be done for two reasons: - First, error propagation. Value-based exceptions cannot be propagated through constructors, so special methods are already better for this. - If Vector copying uses special methods instead of implicit C++ stuff, we can create two copy variants: shallow_copy() and deep_copy(). shallow_copy() can be good for performance when dealing with POD types (since we can use plain old memcpy), but obviously deep_copy() is necessary for non-POD data (e.g. Strings). This is just a TODO reminder for now, as I'm working on public API documentation as of right now.
apio added the
enhancement
label 2023-06-09 20:27:31 +00:00
apio self-assigned this 2023-06-09 20:27:31 +00:00
apio closed this issue 2023-06-09 20:54:33 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: apio/Luna#28
No description provided.