This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SSVU_FASTFUNC | |
#define SSVU_FASTFUNC | |
#include <cstring> | |
#include <type_traits> | |
#include <cassert> | |
#include <cstddef> | |
#include <memory> | |
#include <new> | |
#include <utility> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <uint32_t N, typename... Args> | |
void _snprintf(char (&buf)[N], const char* format, Args&&... args) | |
{ | |
snprintf(buf, N, format, args...); | |
buf[N-1] = '\0'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
int main() | |
{ | |
auto Data = | |
std::unique_ptr<double, decltype(free)*>{ | |
reinterpret_cast<double*>(malloc(sizeof(double)*50)), | |
free }; | |
return 0; | |
} |