Fruit is a modern dependency-injection framework for C++ that brings type-safe, compile-time-checked wiring to large codebases. Instead of relying on runtime string keys or service locators, bindings are expressed with templates and policy objects that the compiler verifies. It supports constructor injection, assisted injection for factory patterns, scoping (singleton vs. per-request), and provider chains while keeping overhead minimal. Modules declare provided interfaces and requirements, and the injector ensures the whole graph is complete before you ship, eliminating many runtime surprises. Because bindings are ordinary C++ code, they integrate naturally with headers, visibility rules, and link-time optimization. Fruit’s design aims to deliver the ergonomics of DI frameworks from managed languages while staying faithful to C++ performance and compile-time guarantees.

Features

  • Compile-time validated bindings with strong C++ typing
  • Constructor and assisted injection with factories
  • Scopes and providers for lifecycle control
  • Modular components with explicit requirements and exports
  • Minimal runtime overhead and good LTO friendliness
  • Clear error messages for missing or conflicting bindings

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

Apache License V2.0

Follow Fruit

Fruit Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Fruit!

Additional Project Details

Programming Language

C++

Related Categories

C++ Frameworks

Registered

2025-10-10