From 533d458b43402c2b23c5adb9e13c20d0038c05c0 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 8 Apr 2020 20:29:14 -0700 Subject: [PATCH] Fill in missing const on Fn member functions --- include/cxx.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cxx.h b/include/cxx.h index 8bdbc901a..5de479c4f 100644 --- a/include/cxx.h +++ b/include/cxx.h @@ -154,8 +154,8 @@ template class Fn; template class Fn { public: - Ret operator()(Args... args) noexcept(!Throws); - Fn operator*() noexcept; + Ret operator()(Args... args) const noexcept(!Throws); + Fn operator*() const noexcept; private: Ret (*trampoline)(Args..., void *fn) noexcept(!Throws); @@ -201,12 +201,12 @@ constexpr unsafe_bitcopy_t unsafe_bitcopy{}; #endif // CXXBRIDGE02_RUST_BITCOPY template -Ret Fn::operator()(Args... args) noexcept(!Throws) { +Ret Fn::operator()(Args... args) const noexcept(!Throws) { return (*this->trampoline)(std::move(args)..., this->fn); } template -Fn Fn::operator*() noexcept { +Fn Fn::operator*() const noexcept { return *this; }