Skip to content

Commit cd8f47b

Browse files
committed
[orc-rt] Hoist std::decay_t out of helper class.
The helper implementation shouldn't differ based on how it's initialized.
1 parent 45405f3 commit cd8f47b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

orc-rt/include/orc-rt/move_only_function.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CallableImpl : public Callable<RetT, ArgTs...> {
4747
}
4848

4949
private:
50-
std::decay_t<CallableT> Callable;
50+
CallableT Callable;
5151
};
5252

5353
} // namespace move_only_function_detail
@@ -66,9 +66,8 @@ class move_only_function<RetT(ArgTs...)> {
6666

6767
template <typename CallableT>
6868
move_only_function(CallableT &&Callable)
69-
: C(std::make_unique<
70-
move_only_function_detail::CallableImpl<CallableT, RetT, ArgTs...>>(
71-
std::forward<CallableT>(Callable))) {}
69+
: C(std::make_unique<move_only_function_detail::CallableImpl<
70+
std::decay_t<CallableT>, RetT, ArgTs...>>(std::move(Callable))) {}
7271

7372
RetT operator()(ArgTs... Params) {
7473
return C->call(std::forward<ArgTs>(Params)...);

0 commit comments

Comments
 (0)