[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
std::function with std::unique_ptr argument
From: |
Rodolfo Schulz de Lima |
Subject: |
std::function with std::unique_ptr argument |
Date: |
Thu, 04 Jun 2009 12:23:35 -0300 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090409) |
Hi, I'm trying to use a std::function with std::unique_ptr arguments but
the std::function invocation ends up using std::unique_ptr copy ctor,
which is private/deleted.
Since std::function is a forward call wrapper, its operator() should
have forwarded properly its arguments to the wrapped function, but
M_invoker(_M_functor, __args...);
and
(*_Base::_M_get_pointer(__functor))(__args...);
doesn't seem to do that. IMHO it should be
_M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
(*_Base::_M_get_pointer(__functor))(std::forward<_ArgTypes>(__args)...);
Any objections?
Regards,
Rodolfo Lima
- std::function with std::unique_ptr argument,
Rodolfo Schulz de Lima <=