util/BindMethod: add `constexpr`

This commit is contained in:
Max Kellermann 2023-10-02 21:45:59 +02:00 committed by Max Kellermann
parent 63d865666e
commit 7e6941acc8
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}