Questions tagged [constant-expression]
Use this whenever compile-time expression is implemented (currently exists in C++ and D). Do not use this tag if the compile-time evaluation property is achieved through template metaprogramming in C++ (in which case use the [template-meta-programming] tag).
21 questions
2 votes
0 answers
112 views
compile time, but Not inlined function in C and C++
We have a graphics library for the Ti84CE, which uses the 24bit eZ80. It has a 16bit 1555 screen, so we have a gfx_Darken function that will darken a 16bit 1555 ...
2 votes
0 answers
107 views
std::ranges compile time (and run time) RFC 4648 compliant Base16 conversions in C++23 (improved 2)
This increment This obsoletes a former version, after taking a great review into account: The encoding now preserves sized_range and ...
4 votes
2 answers
386 views
Compile time (and run time) RFC 4648 compliant Base16 conversions as range adaptors in C++23
This obsoletes a former version and is obsoleted by an improved version. The following code is an implementation of, in ambition, RFC 4648 compliant Base16 conversions as range adaptors in C++23. It ...
4 votes
1 answer
214 views
Row-sparse constexpr 2D array, generated at compile-time from array coordinate/value entries
The goal of the code is to enable me to express a 2D array in an unsorted coordinate-sparse representation in my code (i.e. a list of individual x, y, value entries ...
5 votes
1 answer
688 views
Compile-time Matrix Class
Intended as a small project to test out various C++20 features, as well as learn a little bit more about matrices and their uses, I decided to implement a relatively simple matrix class. After ...
2 votes
1 answer
3k views
constexpr hash function
Here's a constexpr hash function, that will pack a string into the largest unsigned integral type available. So, what do you think? ...
2 votes
1 answer
235 views
type erased pointer to member function callable and SFINAE [closed]
I'm implementing a std::function like class that uses type erasure. So far it can be used with function objects (functions/function pointers, functors, lamdas) and pointer to member function. But to ...
2 votes
2 answers
2k views
C++ ring buffer using some C++ 17 and coming C++ 20 std::span
When I heard about the new Linux I/O interface io_uring I searched about the ring buffer. I then thought I may replace my safe queue which is base on C++ 11 ...