mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
add noexcept
Update safestl.h
This commit is contained in:
parent
e41a525f25
commit
6f33639fbd
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user