mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-09 12:31:06 -04:00
Cleanup
This commit is contained in:
parent
387777438b
commit
35fa166829
@ -52,8 +52,14 @@ public:
|
||||
|
||||
//Copy constructors
|
||||
|
||||
basic_string(const basic_string& rhs) : _size(rhs._size), _capacity(rhs._capacity), _data(new CharT[_capacity]) {
|
||||
basic_string(const basic_string& rhs) : _size(rhs._size), _capacity(rhs._capacity) {
|
||||
if(_capacity > 0){
|
||||
_data = new CharT[_capacity];
|
||||
|
||||
std::copy_n(_data, rhs._data, _size + 1);
|
||||
} else {
|
||||
_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
basic_string& operator=(const basic_string& rhs){
|
||||
|
Loading…
x
Reference in New Issue
Block a user