Skip to content

Instantly share code, notes, and snippets.

@CyberDNIWE
CyberDNIWE / variant.cc
Created November 21, 2022 11:39 — forked from tibordp/variant.cc
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
@CyberDNIWE
CyberDNIWE / variant.cpp
Created November 16, 2022 17:29 — forked from calebh/variant.cpp
C++ variant indexed by integer with no standard library dependency
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the