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
In C++, unique_ptr and shared_ptr require a value, since they have ownership over it -- but in this case, since we don't wrap a pointer but return actual unintialized memory, I was wondering if the unique_ptr and shared_ptr macro should take a mandatory value and initialize the memory with it.
Parenthesis over the value are unfortunate, but would be mandatory to allow struct and array literals to be passed, since curly braces are known to not group commas together in macro parameters.
I am still not sure about that to be honest since one could desire to initialize the memory in a more specific way, but to be fair, that's what smalloc should be for.
The text was updated successfully, but these errors were encountered:
In C++, unique_ptr and shared_ptr require a value, since they have ownership over it -- but in this case, since we don't wrap a pointer but return actual unintialized memory, I was wondering if the unique_ptr and shared_ptr macro should take a mandatory value and initialize the memory with it.
Usage would be:
Parenthesis over the value are unfortunate, but would be mandatory to allow struct and array literals to be passed, since curly braces are known to not group commas together in macro parameters.
I am still not sure about that to be honest since one could desire to initialize the memory in a more specific way, but to be fair, that's what smalloc should be for.
The text was updated successfully, but these errors were encountered: