Title
function does not need an explicit default constructor
Status
c++11
Section
[func.wrap.func]
Submitter
Japan

Created on 2010-08-25.00:00:00 last changed 162 months ago

Messages

Date: 2011-05-21.21:15:19

Proposed resolution:

Remove explicit.

namespace std {
template<class> class function;
// undefined
template<class R, class... ArgTypes>
class function<R(ArgTypes...)>
: public unary_function<T1, R>
// iff sizeof...(ArgTypes) == 1 and ArgTypes contains T1
: public binary_function<T1, T2, R>
// iff sizeof...(ArgTypes) == 2 and ArgTypes contains T1 andT2
{
public:typedef R result_type;
// 20.8.14.2.1, construct/copy/destroy:
  explicit function();
Date: 2010-10-24.10:50:39

[ Resolved in Rapperswil by a motion to directly apply the words from the ballot comment in N3102. ]

Date: 2010-10-24.10:50:39

Addresses JP-3

explicit default contructor is defined in std::function. Although it is allowed according to 12.3.1, it seems unnecessary to qualify the constructor as explicit. If it is explicit, there will be a limitation in initializer_list.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-24 10:50:39adminsetmessages: + msg5015
2010-10-24 10:50:39adminsetstatus: nad editorial -> wp
2010-10-21 19:47:27adminsetmessages: + msg4806
2010-08-25 00:00:00admincreate