Struct thrust::unary_negate
unary_negate
is a function object adaptor: it is an Adaptable Predicate that represents the logical negation of some other Adaptable Predicate. That is: if f
is an object of class unary_negate<AdaptablePredicate>
, then there exists an object pred
of class AdaptablePredicate
such that f(x)
always returns the same value as !pred(x)
. There is rarely any reason to construct a unary_negate
directly; it is almost always easier to use the helper function not1.
Inherits From: thrust::unary_function< Predicate::argument_type, bool >
See:
#include <thrust/functional.h>
template <typename Predicate> struct thrust::unary_negate { public:
/* Inherited from thrust::unary_function< Predicate::argument_type, bool >
*/
/* The type of the function object's argument. */ typedef see below argument_type;
/* Inherited from thrust::unary_function< Predicate::argument_type, bool >
*/
/* The type of the function object's result. */ typedef see below result_type;
explicit _CCCL_HOST_DEVICE unary_negate(Predicate p);
_CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE bool operator()(const typename Predicate::argument_type & x); };
Member Functions
Function thrust::unary_negate::unary_negate
explicit _CCCL_HOST_DEVICE unary_negate(Predicate p);
Constructor takes a Predicate
object to negate.
Function Parameters: p
: The Predicate
object to negate.
Function thrust::unary_negate::operator()
_CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE bool operator()(const typename Predicate::argument_type & x);
Function call operator. The return value is !pred(x)
.