constexpr all the things

It’s frustrating when you go all “in on” constexpr, only to be hamstrung by bits of the Standard Library that aren’t yet constexpr.

See the repo.

This is static library that provides an implementation for my other projects.

Goals


-- The CXX compiler identification is GNU 15.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /builds/deanturpin/constd/build
gmake[1]: Entering directory '/builds/deanturpin/constd/build'
gmake[2]: Entering directory '/builds/deanturpin/constd/build'
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
[ 11%] Building CXX object CMakeFiles/constd.dir/src/constd.cxx.o
[ 22%] Linking CXX static library libconstd.a
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
[ 22%] Built target constd
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
gmake[3]: Entering directory '/builds/deanturpin/constd/build'
[ 33%] Building CXX object CMakeFiles/constd_main.dir/src/main.cxx.o
[ 44%] Building CXX object CMakeFiles/constd_benchmark.dir/src/benchmark.cxx.o
[ 55%] Building CXX object CMakeFiles/constd_benchmark.dir/src/isprint.cxx.o
[ 66%] Building CXX object CMakeFiles/constd_benchmark.dir/src/isxdigit.cxx.o
[ 77%] Building CXX object CMakeFiles/constd_benchmark.dir/src/stod.cxx.o
[ 88%] Linking CXX executable constd_main
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
[ 88%] Built target constd_main
[100%] Linking CXX executable constd_benchmark
gmake[3]: Leaving directory '/builds/deanturpin/constd/build'
[100%] Built target constd_benchmark
gmake[2]: Leaving directory '/builds/deanturpin/constd/build'
gmake[1]: Leaving directory '/builds/deanturpin/constd/build'
--------------------------------------------------------------------
Benchmark                          Time             CPU   Iterations
--------------------------------------------------------------------
BM_isprint_constexpr           0.169 ns        0.169 ns   1000000000
BM_isprint                      2.65 ns         2.65 ns    255976275
BM_isprint_fuzz_constexpr      0.688 ns        0.687 ns   1000000000
BM_isprint_fuzz                 2.82 ns         2.82 ns    248638915
BM_isxdigit_constexpr          0.166 ns        0.166 ns   1000000000
BM_isxdigit                    0.166 ns        0.166 ns   1000000000
BM_stod_constexpr              0.167 ns        0.167 ns   1000000000
BM_stod_constexpr2             0.168 ns        0.168 ns   1000000000
BM_stod                         18.4 ns         18.4 ns     37298139
BM_stod2                        65.3 ns         65.3 ns     10678489
commit 5d3d3b927f4435a17f275b56b4693c0d6a17a4b4
Author: DeanT <dean@germs.dev>
Date:   Tue May 14 22:09:21 2024 +0100

    no triggers

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3b3fd77..5d11466 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,9 +16,3 @@ pages:
   - mkdir public/
   - pandoc index.md --standalone -o public/index.html
 
-# Trigger dependees
-trigger:
-
-  stage: deploy
-  trigger: deanturpin/cmake-external-project
-  only: [main]
diff --git a/todo.md b/todo.md
index 0a9321b..e27ae83 100644
--- a/todo.md
+++ b/todo.md
@@ -1,5 +1,7 @@
 # Things to do (people to see)
 
+- [ ] `is_valid_mac` test
+- [ ] `is_valid_ip` test
 - [ ] Why are isprint implementations not equivalent for large integers?
 
 ```cpp
SLOC    Directory   SLOC-by-Language (Sorted)
Total Physical Source Lines of Code (SLOC)                = 115
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Total Estimated Cost to Develop                           = $ 2,789
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."