Constexpr Advent of Code

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • In the spirit of constexpr all the things, I thought if I could do advent of code completely at compile time. Right now, I am reworking the solutions I already have to be able to run completely constexpr. You can have a look at https://gitlab.com/n31415/compile_time_aoc/-/tree/trunk

  • compile-time-regular-expressions

    Compile Time Regular Expression in C++

  • Constexpr functions also make certain metaprogramming tricks a lot easier. Where before, you'd instanciate lots of templates to compute a value recursively, you can often just have a constexpr function compute the value iteratively. High-performance libraries rely a lot on such tricks to optimize code. E.g. the CTRE library is made up almost entirely of constexpr functions, and allows the libary to instanciate a state machine for parsing your regex at compile-time. This allows for significantly faster regex-matching at runtime. Take a look at this file to get an idea just how much can be done with constexpr functions.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • constexpr-8cc

    Compile-time C Compiler implemented as C++14 constant expressions

  • Is C enough? https://github.com/keiichiw/constexpr-8cc

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts