Skip to content

Commit

Permalink
added perfect forwarding in invoke() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
d5 committed Feb 9, 2012
1 parent 2421903 commit dc17d4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion native/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace native
{
auto x = dynamic_cast<internal::callback_object<callback_t>*>(reinterpret_cast<callbacks*>(target)->lut_[cid].get());
assert(x);
return x->invoke(args...);
return x->invoke(std::forward<A>(args)...);
}

private:
Expand Down
2 changes: 1 addition & 1 deletion native/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace native
template<typename callback_t, typename ...A>
typename std::result_of<callback_t(A...)>::type invoke_from_req(uv_fs_t* req, A&& ... args)
{
return callbacks::invoke<callback_t>(req->data, 0, args...);
return callbacks::invoke<callback_t>(req->data, 0, std::forward<A>(args)...);
}

template<typename callback_t, typename data_t>
Expand Down

0 comments on commit dc17d4b

Please sign in to comment.