Merge pull request #87778 from aaronfranke/callable-bind-const

Make Callable `bind` method const
This commit is contained in:
Rémi Verschelde 2024-02-22 11:23:03 +01:00
commit 7c3c90a3e4
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 2 additions and 2 deletions

View file

@ -99,7 +99,7 @@ public:
bool is_valid() const;
template <typename... VarArgs>
Callable bind(VarArgs... p_args);
Callable bind(VarArgs... p_args) const;
Callable bindv(const Array &p_arguments);
Callable bindp(const Variant **p_arguments, int p_argcount) const;

View file

@ -865,7 +865,7 @@ Variant Callable::call(VarArgs... p_args) const {
}
template <typename... VarArgs>
Callable Callable::bind(VarArgs... p_args) {
Callable Callable::bind(VarArgs... p_args) const {
Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported.
const Variant *argptrs[sizeof...(p_args) + 1];
for (uint32_t i = 0; i < sizeof...(p_args); i++) {