aboutsummaryrefslogtreecommitdiff
path: root/src/DI/container.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-14 18:02:18 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commitdc6222611ad14a33f642396558ba84ecba9d6605 (patch)
treed759020233b66be62c5539209a03842d283b67a9 /src/DI/container.hpp
parentdbab54ebf134b6ab2cf719d7c26a191fbffeed34 (diff)
perf: add noexcept almost everywhere
Diffstat (limited to 'src/DI/container.hpp')
-rw-r--r--src/DI/container.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/DI/container.hpp b/src/DI/container.hpp
index 93722b6..974780a 100644
--- a/src/DI/container.hpp
+++ b/src/DI/container.hpp
@@ -14,13 +14,13 @@ template <typename Interface>
class BindingBuilder
{
public:
- explicit BindingBuilder(Container *container);
+ explicit BindingBuilder(Container *container) noexcept;
template <class ObjectImpl,
class = std::enable_if_t<std::is_base_of_v<Interface, ObjectImpl>>>
- void to();
+ void to() noexcept;
- void to_factory(Interface func);
+ void to_factory(Interface func) noexcept;
private:
Container *_container;
@@ -29,16 +29,16 @@ private:
class Container
{
public:
- Container() = default;
+ Container() noexcept = default;
template <class Interface>
- BindingBuilder<Interface> bind();
+ BindingBuilder<Interface> bind() noexcept;
template <class Interface, class = std::enable_if_t<std::is_class_v<Interface>>>
- std::shared_ptr<Interface> get() const;
+ std::shared_ptr<Interface> get() const noexcept;
template <typename Interface, typename = std::enable_if_t<is_func_v<Interface>>>
- Interface get() const;
+ Interface get() const noexcept;
std::unordered_map<BaseObjectType, std::shared_ptr<IGenericWrapper>, ObjectTypeHasher>
bindings;