Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add til::static_map, a constexpr key-value store #7323

Merged
5 commits merged into from
Aug 18, 2020
Merged

Commits on Aug 17, 2020

  1. Add til::static_map, a constexpr key-value store

    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)`.
    DHowett committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    2d93bbc View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. Configuration menu
    Copy the full SHA
    17dd263 View commit details
    Browse the repository at this point in the history
  2. format

    DHowett committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    eb8503d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    10d967e View commit details
    Browse the repository at this point in the history
  4. No need to suppress this

    DHowett committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    bd08596 View commit details
    Browse the repository at this point in the history