Added casting and control flow nodes to data processor

This commit is contained in:
WerWolv
2021-01-31 01:42:29 +01:00
parent 8dd76a6cc8
commit 5a59bc2abc
3 changed files with 276 additions and 14 deletions

View File

@@ -172,6 +172,14 @@ namespace hex {
std::vector<u8> readFile(std::string_view path);
template<typename T>
std::vector<u8> toBytes(T value) {
std::vector<u8> bytes(sizeof(T));
std::memcpy(bytes.data(), &value, sizeof(T));
return bytes;
}
#define SCOPE_EXIT(func) ScopeExit TOKEN_CONCAT(scopeGuard, __COUNTER__)([&] { func })
class ScopeExit {
public: