diff --git a/BAN/include/BAN/Function.h b/BAN/include/BAN/Function.h index 478f9ee60a..0e5f7d5f1f 100644 --- a/BAN/include/BAN/Function.h +++ b/BAN/include/BAN/Function.h @@ -43,10 +43,10 @@ namespace BAN clear(); } - Ret operator()(Args... args) + Ret operator()(Args... args) const { ASSERT(*this); - return reinterpret_cast(m_storage)->call(forward(args)...); + return reinterpret_cast(m_storage)->call(forward(args)...); } operator bool() const @@ -70,7 +70,7 @@ namespace BAN struct CallableBase { virtual ~CallableBase() {} - virtual Ret call(Args...) = 0; + virtual Ret call(Args...) const = 0; }; struct CallablePointer : public CallableBase @@ -79,7 +79,7 @@ namespace BAN : m_function(function) { } - virtual Ret call(Args... args) override + virtual Ret call(Args... args) const override { return m_function(forward(args)...); } @@ -96,7 +96,7 @@ namespace BAN , m_function(function) { } - virtual Ret call(Args... args) override + virtual Ret call(Args... args) const override { return (m_owner->*m_function)(forward(args)...); } @@ -114,7 +114,7 @@ namespace BAN , m_function(function) { } - virtual Ret call(Args... args) override + virtual Ret call(Args... args) const override { return (m_owner->*m_function)(forward(args)...); } @@ -131,7 +131,7 @@ namespace BAN : m_lambda(lambda) { } - virtual Ret call(Args... args) override + virtual Ret call(Args... args) const override { return m_lambda(forward(args)...); }