Skip to content

Instantly share code, notes, and snippets.

View willwray's full-sized avatar

Will Wray willwray

View GitHub Profile
@willwray
willwray / tupl_amalgam.hpp
Last active June 26, 2023 17:32
Amalgamated header for tupl library
/*
SPDX-FileCopyrightText: 2023 The Lemuriad <opensource@lemurianlabs.com>
SPDX-License-Identifier: BSL-1.0
Repo: https://github.com/Lemuriad/tupl
tupl is a C++20 type implemented as a rule-of-zero aggregate struct.
Tested on GCC, Clang and recent MSVC.
tupl_amalgam.hpp is a single header amalgamated from tupl #include's
@willwray
willwray / Rotations2.ipynb
Created May 7, 2021 16:01
A computational notebook on rotation geometry
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willwray
willwray / array.hpp
Created August 18, 2020 13:35
simple c++20 array
// https://godbolt.org/z/cdjrj4
#include <compare>
#include <concepts>
// same_ish<T> utility concept to match a forwarding reference argument <T>(T&& a)
template <typename T, typename U> concept same_ish = std::same_as<std::remove_cvref_t<T>,U>;
template <typename A> concept zero_size_array = sizeof(A) == 0 && ! std::is_class_v<A>;
// carray concept designed to match zero-size arrays as well as bounded C-arrays
@willwray
willwray / auto_name.cpp
Created September 20, 2018 14:13
MSVC test pretty print of type and auto template args
#include <iostream>
#include <string_view>
// typesig_s<T>() size of full pretty print output with template type arg T
template <typename>
constexpr auto typesig_s()
{
return sizeof(__FUNCSIG__);
}
@willwray
willwray / keybase.md
Created September 11, 2017 21:08
willwray keybase id

Keybase proof

I hereby claim:

  • I am willwray on github.
  • I am willwray (https://keybase.io/willwray) on keybase.
  • I have a public key ASBq_NL1sCkYlUS-hhiwCEi4Xj0Lg_bDKkIm3qafP4UPFAo

To claim this, I am signing this object: