New paper: N3699, A proposal to add a generalized callable negator -- Tomasz Kamiński

Note: This paper explores potential future standardization directions and alternatives. It does not discuss or propose to amend the C++14 Committee Draft paper whose ballot is currently in progress.

 

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3699

Date: 2013-05-27

A proposal to add a generalized callable negator

by Tomasz Kamiński

Excerpt:

The standard negators not1 and not2 accept only unary and binary functors that define argument_type or first_argument_type and second_argument_type respectively, which make them unusable with results of standard library functions such as bind and mem_fn. Furthermore, with relation to N3421, they cannot be used with new operator functor specializations.

This proposal addresses the problem by introducing a template function not_fn that returns complement of arbitrary predicate.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.