mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu says: Changelog: - nall: converted range, iterator, vector to 64-bit - added (very poor) ColecoVision emulation (including Coleco Adam expansion) - added MSX skeleton - added Neo Geo Pocket skeleton - moved audio,video,resource folders into emulator folder - SFC heuristics: BS-X Town cart is "ZBSJ" [hex_usr] The nall change is for future work on things like BPA: I need to be able to handle files larger than 4GB. It is extremely possible that there are still some truncations to 32-bit lurking around, and even more disastrously, possibly some -1s lurking that won't sign-extend to `(uint64_t)0-1`. There's a lot more classes left to do: `string`, `array_view`, `array_span`, etc.
28 lines
664 B
C++
28 lines
664 B
C++
#pragma once
|
|
|
|
namespace nall {
|
|
|
|
template<typename T> auto vector<T>::operator=(const vector<T>& source) -> vector<T>& {
|
|
if(this == &source) return *this;
|
|
_pool = memory::allocate<T>(source._size);
|
|
_size = source._size;
|
|
_left = 0;
|
|
_right = 0;
|
|
for(uint64_t n : range(_size)) new(_pool + n) T(source._pool[n]);
|
|
return *this;
|
|
}
|
|
|
|
template<typename T> auto vector<T>::operator=(vector<T>&& source) -> vector<T>& {
|
|
if(this == &source) return *this;
|
|
_pool = source._pool;
|
|
_size = source._size;
|
|
_left = source._left;
|
|
_right = source._right;
|
|
source._pool = nullptr;
|
|
source._size = 0;
|
|
source._left = 0;
|
|
source._right = 0;
|
|
return *this;
|
|
}
|
|
|
|
}
|