add noexcept

Update safestl.h
This commit is contained in:
blueloveTH 2022-12-12 20:06:10 +08:00
parent e41a525f25
commit 6f33639fbd
2 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ namespace pkpy{
shared_ptr(const shared_ptr& other) : counter(other.counter) {
_inc_counter();
}
shared_ptr(shared_ptr&& other) : counter(other.counter) {
shared_ptr(shared_ptr&& other) noexcept : counter(other.counter) {
other.counter = nullptr;
}
~shared_ptr() {
@ -49,7 +49,7 @@ namespace pkpy{
return *this;
}
shared_ptr& operator=(shared_ptr&& other) {
shared_ptr& operator=(shared_ptr&& other) noexcept {
if (this != &other) {
_dec_counter();
counter = other.counter;

View File

@ -113,14 +113,14 @@ namespace pkpy {
}
}
ArgList(ArgList&& other){
ArgList(ArgList&& other) noexcept {
this->_args = other._args;
this->_size = other._size;
other._args = nullptr;
other._size = 0;
}
ArgList(PyVarList&& other){
ArgList(PyVarList&& other) noexcept {
__tryAlloc(other.size());
for(uint8_t i=0; i<_size; i++){
_args[i] = std::move(other[i]);
@ -147,7 +147,7 @@ namespace pkpy {
}
// overload = for &&
ArgList& operator=(ArgList&& other){
ArgList& operator=(ArgList&& other) noexcept {
if(this != &other){
__tryRelease();
this->_args = other._args;