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
andnot2
accept only unary and binary functors that defineargument_type
orfirst_argument_type
andsecond_argument_type
respectively, which make them unusable with results of standard library functions such asbind
andmem_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.