aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/basic/src/bootstrap.cpp4
-rw-r--r--examples/basic/src/interfaces/enemy.hpp8
2 files changed, 5 insertions, 7 deletions
diff --git a/examples/basic/src/bootstrap.cpp b/examples/basic/src/bootstrap.cpp
index ac81bd9..78c5a37 100644
--- a/examples/basic/src/bootstrap.cpp
+++ b/examples/basic/src/bootstrap.cpp
@@ -27,7 +27,7 @@ auto bootstrap() -> yacppdic::Container
return std::make_unique<Enemy>(65);
}
)
- .when_tagged(SMALL_ENEMY_TAG);
+ .when_tagged<SMALL_ENEMY_TAG>();
container.bind<IEnemyFactory>()
.to_factory(
@@ -36,7 +36,7 @@ auto bootstrap() -> yacppdic::Container
return std::make_unique<Enemy>(130);
}
)
- .when_tagged(BIG_ENEMY_TAG);
+ .when_tagged<BIG_ENEMY_TAG>();
return container;
}
diff --git a/examples/basic/src/interfaces/enemy.hpp b/examples/basic/src/interfaces/enemy.hpp
index 5ad7d90..d0b6337 100644
--- a/examples/basic/src/interfaces/enemy.hpp
+++ b/examples/basic/src/interfaces/enemy.hpp
@@ -1,14 +1,12 @@
#pragma once
#include <yacppdic/factory.hpp>
+#include <yacppdic/tagging.hpp>
#include <memory>
-// NOLINTNEXTLINE(modernize-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays)
-constexpr char SMALL_ENEMY_TAG[] = "small";
-
-// NOLINTNEXTLINE(modernize-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays)
-constexpr char BIG_ENEMY_TAG[] = "big";
+constexpr yacppdic::Tag SMALL_ENEMY_TAG = "small";
+constexpr yacppdic::Tag BIG_ENEMY_TAG = "big";
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IEnemy