Daniel Lemire releases useful_abstractions: a single-header C++23 compile-time programming library
lemire · x · 2026-09-16
Performance engineering veteran Daniel Lemire has released usefulabstractions (ConstexprCore), a header-only C++23 library aiming to make compile-time (constexpr/consteval) programming easier — moving hashing, strings, and escaping work from runtime to compile time for faster, safer code.
- One header (2,000 lines), zero dependencies beyond the standard library; also usable via CMake FetchContent/findpackage
- 7 components, each independently includable:
- fixedstring: string literals as non-type template parameters (e.g. naming types like userid)
- constexprhash: compile-time FNV-1a hashing and switch on strings
- typename<T>(): type names and stable typeids without RTTI
- escapestring: JSON, URL, and HTML escaping computed by the compiler
- utfconvert: compile-time UTF-8 validation with precise error codes plus UTF-8→UTF-16/32 conversion
- constexprptr: reinterpretptr/writableptr for type-punning views in constant evaluation, where reinterpretcast fails
- constexprcheck: staticrequire turns failed consteval checks into compiler errors with your own message
- Requires GCC 14+ or Clang 19+; project is early (v0.1.0) and open to contributions
More from coding & agent
- Supabase Select 26 lineup: Steve Wozniak, Garry Tan, and Anthropic execs join Oct 2 event — dshukertjr · 2026-09-16
- Capawesome Ships Three MCP Servers to Stop AI Assistants Suggesting Outdated APIs — DayanaJabif · 2026-09-16
- Synthesia launches real-time Interactive Avatar API on LiveKit — synthesiaIO · 2026-09-16
- Founder ditches $10/mo Super.so as AI agent migrates 100-page site in 5 minutes — thisiskp_ · 2026-09-16
- Open-source cross-connector memory layer lets one agent's verified knowledge transfer to others — Neither-Witness-6010 · 2026-09-16
- Claude Remote: launch Claude Code on your own PC from your phone via Tailscale — TearInternational414 · 2026-09-16