You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
340 B
19 lines
340 B
#pragma once |
|
|
|
#include <iomanip> // std::setfill, std::setw |
|
#include <sstream> // std::stringstream |
|
|
|
namespace Inferno { |
|
|
|
template<typename T> |
|
std::string intToHex(T i) |
|
{ |
|
std::stringstream stream; |
|
stream << "0x" |
|
<< std::setfill('0') << std::setw(sizeof(T) * 2) |
|
<< std::hex << i; |
|
|
|
return stream.str(); |
|
} |
|
|
|
} // namespace Inferno
|
|
|