-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
I tried to modify njson to use more numem:
- .length for vector (also:
slength
for signed length?) -
.ptr
for string - for shared_ptr and unique_ptr,
.ptr
gets repeated a lot, at any point of use. Not sure how alias this can settle that. -
ref inout(T)
for vector index and slices, currently only mutable supported. Tricky with atomics. -
ref inout(T)
for string index and slices
Note during yxml development:
-
unique_ptr!A
not naturally covariant with a B class that would descend from A. This is quite complicated, when involvingvector!unique_ptr
after... ouch -
nogc_delete
crashes if the class instance access its surrounding frame (not a static class). So this shall be documented, I don't see a way out. (EDIT: this is related to std.conv.emplace segfaults for nested types dlang/phobos#10125) -
unique_ptr
can't be copied:perhaps an explicit ".appendMove" operation?unique_ptr!A a = unique_new!A(); vector!(unique_ptr!A) v; v ~= a; // fail v ~= unique_new!A(); // but this works
-
vector!(unique_new!Class)
owns every element. Butvector!(Struct*)
andvector!Class
also own every element. It just bypass the whole move constraint and is more usable for now thanvector!(unique_ptr!Class)
Metadata
Metadata
Assignees
Labels
No labels