Description
Frozen is a header-only C++ library that provides zero-cost initialization for immutable containers, fixed-size containers and a few search algorithms. It offers constexpr-compatible versions of std::set, std::unordered_set, std::map and std::unordered_map whose keys cannot change once they are initialized, which makes lookups faster. The unordered containers are perfect hash tables, so they have no hash collisions, and their extra storage grows linearly with the number of keys. It also includes fixed-capacity, constinit-compatible maps with keys chosen at compile time and mutable values. A version of std::search for frozen needles uses Boyer-Moore or Knuth-Morris-Pratt, and initialization costs nothing when constexpr or constinit is used. The listing describes it as an alternative to gperf for C++14 users. The README says the library is stable and in maintenance mode, but the author still reviews commits that make the code cleaner or faster. You can use it by copying the include/frozen directory, or through CMake.…
Highlights
- Constexpr immutable set and map containers
- Perfect hashing for unordered containers, no collisions
- Fixed-capacity constinit maps with mutable values
- Compile-time search with Boyer-Moore or Knuth-Morris-Pratt
- Header-only: copy the include folder or install with CMake
Ratings & Reviews
No ratings yet
Be the first to rate Frozen.
People also visit
Frozen FAQ
What is Frozen?
A header-only C++ library for immutable, constexpr-friendly containers and compile-time search.
Who is it for?
C++ developers who want a constexpr alternative to gperf, according to the project's description, written for C++14 users.
How do I install it?
Copy the include/frozen directory somewhere and point the compiler at it with -I. Or use CMake, which installs configuration files that find_package can read.
Is it still maintained?
The README says the library is stable and in maintenance mode. The author still accepts commits that make the code cleaner, faster or more modern, but reviews may take a while.
Why use it instead of gperf?
Frozen builds its containers at compile time, so initialization costs nothing at runtime when constexpr or constinit is used.
What are the best Frozen alternatives?
Popular alternatives to Frozen include Fastrange, Re2 and Barkeep. See all Frozen alternatives



