Replace shared_ptr in bignum with unique_ptr #1518
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[ Please outline your change here. Be sure to check the checkboxes below. ]
Code change checklist
Custom destructor is required as type for openssl_bignum is incomplete at compile time and my
g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
on wsl2 refuses to compile it with error
In file included from /usr/include/c++/13/memory:78,
from /home/ilesik/DPP/library/../include/dpp/nlohmann/json_fwd.hpp:14,
from /home/ilesik/DPP/library/../include/dpp/json_fwd.h:25,
from /home/ilesik/DPP/library/../include/dpp/snowflake.h:24,
from /home/ilesik/DPP/library/../include/dpp/dpp.h:36,
from /home/ilesik/DPP/src/unittest/test.h:27,
from /home/ilesik/DPP/src/unittest/test.cpp:22:
/usr/include/c++/13/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = dpp::openssl_bignum]’:
/usr/include/c++/13/bits/unique_ptr.h:404:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = dpp::openssl_bignum; _Dp = std::default_deletedpp::openssl_bignum]’
/home/ilesik/DPP/library/../include/dpp/bignum.h:88:2: required from here
/usr/include/c++/13/bits/unique_ptr.h:97:23: error: invalid application of ‘sizeof’ to incomplete type ‘dpp::openssl_bignum’
97 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~