Your C++14 one header only Dependency Injection library with no dependencies (Try it online!)
Dependency Injection in C++ In this post, I will switch gears from functional C++ to object oriented C++ and talk about dependency injection. Let’s start with a simple example: take a Car class with a Drive() method. ASP.NET Core supports the dependency injection (DI) software design pattern, which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies. For more information specific to dependency injection within MVC controllers, see Dependency injection into controllers.
Quick start

Download
[Boost].DI requires only one file. Get the latest header here!
Include
Compile
- GCC/Clang
- MSVC
Quick guide - Create object graph
Run this example on Wandbox.
| Clang-3.8 | GCC-6 | MSVC-2015 | |
|---|---|---|---|
| Compilation Time | 0.102s | 0.118s | 0.296s |
| Binary size (stripped) | 6.2kb | 6.2kb | 105kb |
| ASM x86-64 |
Quick guide - Bind interfaces

Run this example on Wandbox.
| Clang-3.8 | GCC-6 | MSVC-2015 | |
|---|---|---|---|
| Compilation Time | 0.102s | 0.118s | 0.296s |
| Binary size (stripped) | 6.2kb | 6.2kb | 105kb |
| ASM x86-64 (same as `make_unique`) |
Quick guide - Bind templates
Run this example on Wandbox.
| Clang-3.8 | GCC-6 | MSVC-2015 | |
|---|---|---|---|
| Compilation Time | 0.102s | 0.118s | 0.296s |
| Binary size (stripped) | 6.2kb | 6.2kb | 105kb |
| ASM x86-64 |
Quick guide - Bind concepts
Run this example on Wandbox.
| Clang-3.8 | GCC-6 | MSVC-2015 | |
|---|---|---|---|
| Compilation Time | 0.102s | 0.118s | 0.296s |
| Binary size (stripped) | 6.2kb | 6.2kb | 105kb |
| ASM x86-64 |
Microsoft Visual Studio For Mac
Documentation
C# Dependency Injection Examples
- Introduction
- Overview
- Tutorial
- Benchmarks
- User Guide
- Examples
- Extensions
- CHANGELOG
C# Visual Studio For Beginners
DisclaimerBoost.DI is not an official Boost library.