Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created February 21, 2015 12:56
Show Gist options
  • Save rightfold/136af8dac22705c7d3cd to your computer and use it in GitHub Desktop.
Save rightfold/136af8dac22705c7d3cd to your computer and use it in GitHub Desktop.
template<typename T>
void setRegister(std::size_t index, T value) {
std::get<std::vector<T>>(registers).at(index) = value;
}
template<typename T>
T getRegister() {
return std::get<std::vector<T>>(registers).at(index);
}
std::tuple<
std::vector<std::int8_t>,
std::vector<std::int16_t>,
std::vector<std::int32_t>,
std::vector<std::int64_t>,
std::vector<std::uint8_t>,
std::vector<std::uint16_t>,
std::vector<std::uint32_t>,
std::vector<std::uint64_t>
> registers;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment