Skip to content

Instantly share code, notes, and snippets.

View pparuzel's full-sized avatar
💻
Talk is cheap. Show me the code.

Pawel Paruzel pparuzel

💻
Talk is cheap. Show me the code.
  • Cracow, Poland
View GitHub Profile
@pparuzel
pparuzel / compile_time_evaluation.cpp
Last active January 13, 2022 09:10
Force compile-time evaluation of expressions (no macros)
#ifdef cxx20
#include <concepts>
template <typename Functor>
requires requires (Functor f)
{
{ f() } -> std::same_as<void>;
}
constexpr void const_eval(Functor f)
@pparuzel
pparuzel / sparse_set.cpp
Last active April 12, 2020 21:13
Sparse set implementation in Modern C++ 17
#include <memory> // for sparse array
#include <string> // string manipulation
#include <vector> // for dense array
//////////////////////////
// SPARSE SET //
// time complexity //
// of operations //
//----------------------//
// insert -- O(1) //