Skip to content

Instantly share code, notes, and snippets.

View unrays's full-sized avatar
🐱
Coding while listening to Bach

Félix-Olivier Dumas unrays

🐱
Coding while listening to Bach
  • Computer Science Student · Cégep de Rimouski
  • Rimouski, Québec
View GitHub Profile
@unrays
unrays / sharded-string-interner.hpp
Created May 24, 2026 20:19
High-performance sharded string interner using custom memory allocation and low-contention concurrency design.
// Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
#pragma once
#include <cstddef>
#include <stdexcept>
#include <atomic>
#include <iostream>
#include <new>
@unrays
unrays / exotic_crtp.hpp
Created May 22, 2026 20:00
Exotic CRTP pattern for static polymorphism using variadic mixin composition and C++23 explicit object parameters. Introduces a novel approach to compile-time interface dispatch without runtime overhead.
// Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
// Reference example of the pattern
// See: https://medium.com/@felixolivierdumas/exotic-crtp-rethinking-static-polymorphism-with-c-23-89f9e75e8ffd
#pragma once
#include <iostream>
#include <type_traits>
@unrays
unrays / monotonic_atomic_buffer.hpp
Created May 22, 2026 19:52
Custom memory_resource implementation with an atomic monotonic buffer allocator supporting aligned, lock-free allocations on a preallocated memory region.
// Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
#pragma once
#include <cstddef>
#include <atomic>
#include <stdexcept>
namespace exotic::memory {
@unrays
unrays / unsynchronized_chunk_allocator.hpp
Created May 22, 2026 19:46
Unsynchronized chunk allocator built on a custom memory_resource, featuring monotonic chunk allocation, alignment handling, and basic object construction utilities.
// Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
#pragma once
// This is my own custom memory_resource, but you can either use your own
// or the one from the standard library (std::pmr).
#include "memory_resource.hpp"
#include <cstddef>
@unrays
unrays / dod_registry_core.hpp
Created May 22, 2026 17:29
A C++ data-oriented registry with compile-time type mapping and cache-efficient handle-based storage.
// Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
#pragma once
#include <cstddef>
#include <tuple>
#include <utility>
#include <type_traits>
#include <iostream>
@unrays
unrays / deducing_this.hpp
Last active March 4, 2026 18:02
I'm never going back, insanely generic and flexible implementation of a getter
constexpr EXOTIC_NODISCARD decltype(auto) get(this auto&& self) noexcept {
return std::forward<decltype(self)>(self);
}
@unrays
unrays / CRTPJsonDSLBuilder.hpp
Created March 1, 2026 23:56
Unfinished C++ mini-framework for type-safe JSON construction using CRTP, operator overloading, and generic lambdas.
// Copyright (c) March 2026 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
template<template<typename> class Res, template<typename> class Dis>
struct JsonBuildingPair {
template<typename T>
using Resolver = Res<T>;
template<typename T>
using Dispatcher = Dis<T>;
@unrays
unrays / lyst.hpp
Created January 19, 2026 12:51
Header-only C++ typelist library for template metaprogramming
/*********************************************************************
* EXOTIC.lyst - Header-only C++ typelist library
*
* Copyright (c) 2026 Félix-Olivier Dumas
* All rights reserved.
*
* Licensed under the Boost Software License, Version 1.0.
* You may obtain a copy of the License at:
* https://www.boost.org/LICENSE_1_0.txt
*
@unrays
unrays / lynx.hpp
Created January 19, 2026 12:51
Header-only C++ compile-time pipeline library for DSLs
/*********************************************************************
* EXOTIC.lynx - Header-only C++ compile-time pipeline library
*
* Copyright (c) 2026 Félix-Olivier Dumas
* All rights reserved.
*
* Licensed under the Boost Software License, Version 1.0.
* You may obtain a copy of the License at:
* https://www.boost.org/LICENSE_1_0.txt
*
@unrays
unrays / alloc.cpp
Created January 19, 2026 12:51
Basic C++ template allocator example
// Copyright (c) December 2025 Félix-Olivier Dumas. All rights reserved.
// Licensed under the terms described in the LICENSE file
#include <iostream>
struct Point {
int x, y;
Point(int a, int b) : x(a), y(b) {}
void print() { std::cout << "(" << x << "," << y << ")\n"; }
};