aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/bootstrap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic/src/bootstrap.cpp')
-rw-r--r--examples/basic/src/bootstrap.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/basic/src/bootstrap.cpp b/examples/basic/src/bootstrap.cpp
index fe59c5d..38edcc3 100644
--- a/examples/basic/src/bootstrap.cpp
+++ b/examples/basic/src/bootstrap.cpp
@@ -16,7 +16,13 @@ yacppdic::Container bootstrap()
container.bind<IHero>().to<Hero>();
container.bind<IWeapon>().to<Sword>();
- container.bind<IEnemy>().to<Enemy>();
+
+ container.bind<IEnemyFactory>().to_factory(
+ []()
+ {
+ return std::make_unique<Enemy>();
+ }
+ );
return container;
}