mirror of
https://github.com/libretro/bsnes-libretro.git
synced 2024-11-23 08:59:40 +00:00
903d1e4012
* GB: integrated SameBoy v0.12.1 by Lior Halphon * SFC: added HG51B169 (Cx4) math tables into bsnes binary
30 lines
680 B
C++
Executable File
30 lines
680 B
C++
Executable File
#pragma once
|
|
|
|
#include <utility>
|
|
|
|
namespace nall {
|
|
|
|
using std::tuple;
|
|
|
|
template<typename T> struct base_from_member {
|
|
base_from_member(T value) : value(value) {}
|
|
T value;
|
|
};
|
|
|
|
template<typename To, typename With> struct castable {
|
|
operator To&() { return (To&)value; }
|
|
operator const To&() const { return (const To&)value; }
|
|
operator With&() { return value; }
|
|
operator const With&() const { return value; }
|
|
auto& operator=(const With& value) { return this->value = value; }
|
|
With value;
|
|
};
|
|
|
|
template<typename T> inline auto allocate(uint size, const T& value) -> T* {
|
|
T* array = new T[size];
|
|
for(uint i = 0; i < size; i++) array[i] = value;
|
|
return array;
|
|
}
|
|
|
|
}
|