Skip to content
Hypodermic is an IoC container for C++. It provides dependency injection to your existing design.
C++ CMake C
Branch: master
Clone or download
Latest commit 3e86a5a Oct 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Hypodermic.Tests Log warn on duplicated base type registration instead of failing to c… Oct 15, 2019
Hypodermic Log warn on duplicated base type registration instead of failing to c… Oct 15, 2019
resources updating icon Apr 7, 2016
.gitignore .gitignore updated Apr 25, 2016
.travis.yml typo Oct 15, 2019
CMakeLists.txt
Hypodermic.props
Hypodermic.sln solution upgraded to visual studio 2015 Feb 10, 2016
LICENSE Update LICENSE Mar 4, 2016
README.md Update README.md May 24, 2017
appveyor.yml Fixing appveyor.yml Oct 24, 2018
boost.props Introduce container validation Jul 11, 2018
cmake_uninstall.cmake.in

README.md

Hypodermic

MIT license Build status Build Status

Hypodermic is a non-intrusive header only IoC container for C++. It provides dependency injection to your existing design by managing the creation of your components and their dependencies in the right order, sparing you the trouble of writing and maintaining boiler plate code.

Used in production environments since 2012.

First steps

Configure the container by registering your components

ContainerBuilder builder;

builder.registerType< MessageDispatcher >();

auto container = builder.build();

... then ask the container to give you an instance of that type

auto dispatcher = container->resolve< MessageDispatcher >();

Want to discover what happened here? Learn to use more features through the beginner's guide on the wiki.

Benchmarks

Some comparative benchmarks are available on the wiki, check them out.

Acknowledgment

Hypodermic was started with the will to mimic the famous .NET Autofac http://autofac.org/. Although its design evolved, both its behavior and its expressiveness tend to remain the same.

Constructor deduction has been made possible thanks to the work of Krzysztof Jusiak in http://boost-experimental.github.io/di/.

You can’t perform that action at this time.