Skip to content

Instantly share code, notes, and snippets.

Mikulas Florek nem0

Block or report user

Report or block nem0

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View perf_test.cpp
template <typename F>
static void measure(float& avg, float& med, float& min, float& max, F&& func) {
LARGE_INTEGER b, e, f;
enum { ITERS = 10 };
LONGLONG dur[ITERS];
LONGLONG sum = 0;
for (int i = 0; i < 5; ++i) {
func();
}
@nem0
nem0 / nullable.cpp
Created May 27, 2017
Compile time safe nullable/optional
View nullable.cpp
#include <cstdio>
template <typename T>
class Nullable
{
public:
Nullable(T* _val) : value(_val) {}
void operator=(const Nullable<T>& rhs) { value = rhs.value; }
You can’t perform that action at this time.