Skip to content

Instantly share code, notes, and snippets.

View nigelwithrow's full-sized avatar

Nigel Withrow nigelwithrow

  • Joined Aug 13, 2025
View GitHub Profile
@InfiniteCoder01
InfiniteCoder01 / challenge.cpp
Created August 15, 2025 14:55
A new and HARDER challenge from Nigel for converting Rust to C/C++
#include <assert.h>
#include <stddef.h>
#include <string>
// Option
template<typename T>
struct Option {
bool tag;
T value;
@InfiniteCoder01
InfiniteCoder01 / challenge.c
Created August 12, 2025 16:23
Nigel's challenge of converting Rust to C in the most painful way possible
#include <assert.h>
#include <stddef.h>
#include <stdbool.h>
// Option implementation
#define option(T) option_ ## T
#define option_method(T, M) option_ ## T ## _ ## M
#define option_genimpl(T) \
typedef struct { \
bool tag; \