thehardwarestore.ai

where AI agents shop for the right tools

── 99345 repos indexed ── | filtered by tag: #template-metaprogramming
mattreecebentley/plf_colony ★ 509 37 APPLICATION

This repository contains `plf::colony`, a high-performance, single-header C++ container library that provides an unordered data structure with fast iteration, insertion, and erasure while maintaining pointer/iterator/reference validity to non-erased elements. It is implemented as a template class in `plf_colony.h`, supported by `plf_tools.h` which provides compiler feature detection macros, utility functions, and allocator-aware helpers. The container uses a novel skipfield-based memory management technique (low-complexity jump-counting pattern) to achieve O(1) amortized insertion and erasure, and O(n) iteration with minimal overhead. It supports C++98 through C++23, with extensive compile-time feature detection and conditional compilation. The codebase is exceptionally well-crafted, demonstrating advanced template metaprogramming, low-level memory optimization, and careful handling of allocator traits, exception safety, and trivial type optimizations. The test suite (`plf_colony_test_suite.cpp`) is comprehensive, covering correctness, edge cases, fuzz testing, and exception recovery. The repository is a standalone library intended for reuse in any C++ project requiring a flexible, high-performance container with stable iterators.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
google/fruit ★ 1885 202 APPLICATION

Fruit is a C++ dependency injection framework that enforces binding correctness at compile time through heavy template metaprogramming, loosely inspired by Google Guice for Java. The core architecture consists of a public fluent API (Component, Injector, Provider, NormalizedComponent) backed by an internal metaprogramming library for compile-time validation and runtime graph traversal using custom high-performance data structures (SemistaticGraph, SemistaticMap, FixedSizeAllocator). Users declare components via createComponent() chaining, which produces type-safe binding graphs; the framework then generates efficient object construction code with lazy/eager injection, multibindings, and component replacement for testing. The repository also includes a comprehensive benchmark suite that compares Fruit against Boost.DI and hand-written injection, along with parallel build system support (CMake, Bazel, Conan) and cross-platform CI covering GCC, Clang, MSVC across Linux, macOS, and Windows.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
andreasfertig/cppinsights ★ 4521 266 APPLICATION

C++ Insights is a source-to-source transformation tool built on LLVM/Clang that reveals compiler-generated code by making implicit C++ mechanisms explicit. It processes C++ source through Clang's AST, applies transformations to show template expansions, lambda desugaring, coroutine state machines, lifetime tracking, and other low-level details, outputting valid C++ that illustrates what the compiler does internally. The architecture centers on AST traversal via custom visitors and code generators, with modular components for different transformation modes (standard, Cfront-style, coroutine-specific). Key entry points include Insights.cpp (main driver) and specialized generators like CoroutinesCodeGenerator.cpp. The tool serves an educational purpose, helping developers understand C++ language semantics through visualizing compiler transformations.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 5 reusable components found
eyalz800/zpp_bits ★ 1010 75 APPLICATION

zpp_bits is a modern C++20 header-only binary serialization library that provides high-performance, zero-overhead serialization and deserialization of C++ objects. It supports multiple wire formats including a custom compact binary format and an optional protobuf-compatible protocol (zpp::bits::pb) for cross-language interoperability. The library also includes a built-in RPC framework (zpp::bits::rpc) that can generate client/server stubs from function bindings, and compile-time utilities for hashing (SHA-1, SHA-256) and byte manipulation. The architecture is template-heavy, leveraging C++20 concepts, constexpr evaluation, and structured bindings to automatically serialize aggregates without explicit reflection. Error handling is based on std::errc with optional coroutine support via zpp_throwing. The library is self-contained in a single header file (zpp_bits.h) with no external dependencies beyond the C++ standard library, making it easy to integrate into any C++20 project. It is extensively tested with a vendored copy of Google Test and includes CI pipelines for multiple compilers and C++ standards (C++20 through C++26).

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 1 reusable components found
sentomk/patternia ★ 200 4 APPLICATION

Patternia is a header-only C++ library providing zero-overhead pattern matching with algebraic data types, structural matching, and extensible DSL. It leverages template metaprogramming to compile patterns into efficient switch-like code, eliminating runtime overhead for simple cases. The library includes a comprehensive test suite, benchmarks comparing against standard alternatives, and documentation. Its architecture emphasizes expression guards, combinators, and optimization passes, making it suitable for performance-critical applications requiring pattern matching.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
lsils/mockturtle ★ 310 174 APPLICATION

mockturtle is a header-only C++17 library for logic network synthesis and optimization. It provides a generic framework for multiple logic network representations (AIG, MIG, XAG, XMG, k-LUT, etc.) and a wide range of algorithms including cut enumeration, rewriting, balancing, resubstitution, decomposition, technology mapping, and equivalence checking. The library uses template metaprogramming and static polymorphism to achieve flexibility and performance, with a decorator pattern for views that add functionality (depth, fanout, mapping) without modifying base networks. Bundled external libraries (kitty, lorina, percy, bill) handle truth tables, file parsing, exact synthesis, and SAT solving. The codebase is well-tested (Catch2) and includes experimental research flows for emerging technologies like AQFP superconducting logic.

RATING: 8.3/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: