terminal/src/til
Dustin L. Howett 66fd9c367d
Add til::static_map, a constexpr key-value store (#7323)
This is based on (cribbed almost directly from) code written by the
inimitable @StephanTLavavej on one of our mailing lists.

This is a nice generic version of the approach used in
JsonUtils::EnumMapper and CodepointWidthDetector: a static array of
key-value pairs that we binary-search at runtime (or at compile time, as
the case may be.)

Keys are not required to be sorted, as we're taking advantage of
constexpr std::sort (VS 16.6+) to get the compiler to do it for us. How
cool is that?

static_map presents an operator[] or at much like
std::map/std::unordered_map does.

I've added some tests, but they're practically fully-solveable at compile
time so they pretty much act like `VERIFY_IS_TRUE(true)`.
2020-08-18 18:05:14 +00:00
..
ut_til Add til::static_map, a constexpr key-value store (#7323) 2020-08-18 18:05:14 +00:00
dirs Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00
precomp.cpp Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00
precomp.h Adjusts High DPI scaling to enable differential rendering (#5345) 2020-04-22 14:59:51 -07:00