Skip to content

Commit

Permalink
Fill in missing const on Fn member functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 9, 2020
1 parent 4ac0b18 commit 533d458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ template <typename Signature, bool Throws = false> class Fn;
template <typename Ret, typename... Args, bool Throws>
class Fn<Ret(Args...), Throws> {
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);
Expand Down Expand Up @@ -201,12 +201,12 @@ constexpr unsafe_bitcopy_t unsafe_bitcopy{};
#endif // CXXBRIDGE02_RUST_BITCOPY

template <typename Ret, typename... Args, bool Throws>
Ret Fn<Ret(Args...), Throws>::operator()(Args... args) noexcept(!Throws) {
Ret Fn<Ret(Args...), Throws>::operator()(Args... args) const noexcept(!Throws) {
return (*this->trampoline)(std::move(args)..., this->fn);
}

template <typename Ret, typename... Args, bool Throws>
Fn<Ret(Args...), Throws> Fn<Ret(Args...), Throws>::operator*() noexcept {
Fn<Ret(Args...), Throws> Fn<Ret(Args...), Throws>::operator*() const noexcept {
return *this;
}

Expand Down

0 comments on commit 533d458

Please sign in to comment.