-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
etl::unique_ptr reset #921
Labels
Comments
Sounds reasonable |
Ok, do you want me to send you a PR? |
jwellbelove
pushed a commit
that referenced
this issue
Jul 19, 2024
* Add an etl::nullptr_t type * etlcpp/etl issue #921 (etl::unique_ptr reset): add etl::unique_ptr(...)::reset(ETL_NULLPTR) Remove default argument for the normal reset method of etl::unique_ptr (sorry, didn't notice 😬) Silence the unused argument warning Fix operator =(nullptr) Replace the nullptr_t enum with a class which acts more similar to C++11 nullptr * Add member pointer support and delete the addressof operator * "Delete" etl::addressof(ETL_NULLPTR) * Ensure compatibility with C++98 * ACTUALLY ensure compatibility with C++98 I'm stupid :/ * Correct definition according to cppreference
jwellbelove
pushed a commit
that referenced
this issue
Jul 28, 2024
* Add an etl::nullptr_t type * etlcpp/etl issue #921 (etl::unique_ptr reset): add etl::unique_ptr(...)::reset(ETL_NULLPTR) Remove default argument for the normal reset method of etl::unique_ptr (sorry, didn't notice 😬) Silence the unused argument warning Fix operator =(nullptr) Replace the nullptr_t enum with a class which acts more similar to C++11 nullptr * Add member pointer support and delete the addressof operator * "Delete" etl::addressof(ETL_NULLPTR) * Ensure compatibility with C++98 * ACTUALLY ensure compatibility with C++98 I'm stupid :/ * Correct definition according to cppreference
Thanks for implementing :) |
github-project-automation
bot
moved this from To do
to Done
in Embedded Template Library
Aug 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have some cases where I need to clear (
reset(nullptr)
) the content of a unique_ptr which may or may not be already cleared.If it is already clear the assertion in
assert(p_ != p);
is triggered.I was wondering if this should be the case since clearing what is already clear does seem fine to me.
I propose the assertion to be changed to
assert(p_ == nullptr || p_ != p);
, or maybe implement the overloadedvoid reset( std::nullptr_t = nullptr )
What do you think?
Regards,
Manuel
The text was updated successfully, but these errors were encountered: