-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add value_ptr #59
Add value_ptr #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting: the opening curly braces should go on a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I mainly have a minor suggestion.
I think |
include/sparrow/memory.hpp
Outdated
template <class T> | ||
class value_ptr { | ||
public: | ||
value_ptr() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unique_ptr
is constexpr
in C++23, I believe this type can also be written all constexpr
although it might not work because of the calls to make_unique
. Anyway, an attempt to make this type all constexpr
would be helpful in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only can support C++20 unfortunately, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be (locally) set to constexpr with a macro only defined when compiling with C++23.
Add value_ptr documentation and update the test
5cabd05
to
1b46062
Compare
Fix #57
Implement value_ptr class