From 7e6941acc84626c103fa438590185d7930e638a6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Oct 2023 21:45:59 +0200 Subject: [PATCH] util/BindMethod: add `constexpr` --- src/util/BindMethod.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/BindMethod.hxx b/src/util/BindMethod.hxx index 1ec985280..8a9964d91 100644 --- a/src/util/BindMethod.hxx +++ b/src/util/BindMethod.hxx @@ -29,7 +29,7 @@ public: /** * Non-initializing trivial constructor */ - BoundMethod() = default; + constexpr BoundMethod() = default; constexpr BoundMethod(void *_instance, function_pointer _function) noexcept @@ -39,12 +39,12 @@ public: * Construct an "undefined" object. It must not be called, * and its "bool" operator returns false. */ - BoundMethod(std::nullptr_t) noexcept:function(nullptr) {} + constexpr BoundMethod(std::nullptr_t) noexcept:function(nullptr) {} /** * Was this object initialized with a valid function pointer? */ - operator bool() const noexcept { + constexpr operator bool() const noexcept { return function != nullptr; }