Created on 2008-01-10.00:00:00 last changed 171 months ago
Proposed resolution:
In [function.objects], header <functional> synopsis, just below of
template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&); template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&&, function<R(ArgTypes...)>&); template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&&);
In [func.wrap.func] class function definition, change
void swap(function&&);
In [func.wrap.func], just below of
template <class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&); template <class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&&, function<R(ArgTypes...)>&); template <class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&&);
In [func.wrap.func.mod] change
void swap(function&& other);
In [func.wrap.func.alg] add the two overloads
template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&& f1, function<R(ArgTypes...)>& f2); template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>& f1, function<R(ArgTypes...)>&& f2);
It is expected that typical implementations of std::function will use dynamic memory allocations at least under given conditions, so it seems appropriate to change the current lvalue swappabilty of this class to rvalue swappability.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg3715 |
2008-01-10 00:00:00 | admin | create |