Skip to content

Commit

Permalink
Drop thrust not1 and not2 (#3264)
Browse files Browse the repository at this point in the history
Fixes: #3263
  • Loading branch information
bernhardmgruber authored Jan 7, 2025
1 parent 61afc05 commit 609018c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 177 deletions.
49 changes: 0 additions & 49 deletions thrust/thrust/detail/functional.inl

This file was deleted.

128 changes: 0 additions & 128 deletions thrust/thrust/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -1082,133 +1082,6 @@ struct project2nd<void, void>
* \{
*/

/*! \p 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 \c f is an object of class <tt>unary_negate<AdaptablePredicate></tt>,
* then there exists an object \c pred of class \c AdaptablePredicate such
* that <tt>f(x)</tt> always returns the same value as <tt>!pred(x)</tt>.
* There is rarely any reason to construct a <tt>unary_negate</tt> directly;
* it is almost always easier to use the helper function not1.
*
* deprecated [Since 2.6]
*
* \see https://en.cppreference.com/w/cpp/utility/functional/unary_negate
* \see not1
*/
template <typename Predicate>
struct CCCL_DEPRECATED unary_negate
{
using argument_type = typename Predicate::argument_type;
using result_type = bool;

/*! Constructor takes a \p Predicate object to negate.
* \param p The \p Predicate object to negate.
*/
_CCCL_HOST_DEVICE explicit unary_negate(Predicate p)
: pred(p)
{}

/*! Function call operator. The return value is <tt>!pred(x)</tt>.
*/
_CCCL_EXEC_CHECK_DISABLE
_CCCL_HOST_DEVICE bool operator()(const typename Predicate::argument_type& x)
{
return !pred(x);
}

/*! \cond
*/
Predicate pred;
/*! \endcond
*/
}; // end unary_negate

_CCCL_SUPPRESS_DEPRECATED_PUSH
/*! \p not1 is a helper function to simplify the creation of Adaptable Predicates:
* it takes an Adaptable Predicate \p pred as an argument and returns a new Adaptable
* Predicate that represents the negation of \p pred. That is: if \c pred is an object
* of a type which models Adaptable Predicate, then the the type of the result
* \c npred of <tt>not1(pred)</tt> is also a model of Adaptable Predicate and
* <tt>npred(x)</tt> always returns the same value as <tt>!pred(x)</tt>.
*
* deprecated [Since 2.6]
*
* \param pred The Adaptable Predicate to negate.
* \return A new object, <tt>npred</tt> such that <tt>npred(x)</tt> always returns
* the same value as <tt>!pred(x)</tt>.
* \tparam Predicate is a model of <a
* href="https://en.cppreference.com/w/cpp/utility/functional/unary_negate">Adaptable Predicate</a>.
* \see unary_negate
* \see not2
*/
template <typename Predicate>
_CCCL_HOST_DEVICE
CCCL_DEPRECATED_BECAUSE("Use thrust::not_fn instead") unary_negate<Predicate> not1(const Predicate& pred);
_CCCL_SUPPRESS_DEPRECATED_POP

/*! \p binary_negate is a function object adaptor: it is an Adaptable Binary
* Predicate that represents the logical negation of some other Adaptable
* Binary Predicate. That is: if \c f is an object of class <tt>binary_negate<AdaptablePredicate></tt>,
* then there exists an object \c pred of class \c AdaptableBinaryPredicate
* such that <tt>f(x,y)</tt> always returns the same value as <tt>!pred(x,y)</tt>.
* There is rarely any reason to construct a <tt>binary_negate</tt> directly;
* it is almost always easier to use the helper function not2.
*
* deprecated [Since 2.6]
*
* \see https://en.cppreference.com/w/cpp/utility/functional/binary_negate
*/
template <typename Predicate>
struct CCCL_DEPRECATED binary_negate
{
using first_argument_type = typename Predicate::first_argument_type;
using second_argument_type = typename Predicate::second_argument_type;
using result_type = bool;

/*! Constructor takes a \p Predicate object to negate.
* \param p The \p Predicate object to negate.
*/
_CCCL_HOST_DEVICE explicit binary_negate(Predicate p)
: pred(p)
{}

/*! Function call operator. The return value is <tt>!pred(x,y)</tt>.
*/
_CCCL_EXEC_CHECK_DISABLE
_CCCL_HOST_DEVICE bool operator()(const first_argument_type& x, const second_argument_type& y)
{
return !pred(x, y);
}

/*! \cond
*/
Predicate pred;
/*! \endcond
*/
}; // end binary_negate

_CCCL_SUPPRESS_DEPRECATED_PUSH
/*! \p not2 is a helper function to simplify the creation of Adaptable Binary Predicates:
* it takes an Adaptable Binary Predicate \p pred as an argument and returns a new Adaptable
* Binary Predicate that represents the negation of \p pred. That is: if \c pred is an object
* of a type which models Adaptable Binary Predicate, then the the type of the result
* \c npred of <tt>not2(pred)</tt> is also a model of Adaptable Binary Predicate and
* <tt>npred(x,y)</tt> always returns the same value as <tt>!pred(x,y)</tt>.
*
* deprecated [Since 2.6]
*
* \param pred The Adaptable Binary Predicate to negate.
* \return A new object, <tt>npred</tt> such that <tt>npred(x,y)</tt> always returns
* the same value as <tt>!pred(x,y)</tt>.
* \tparam Binary Predicate is a model of an Adaptable Binary Predicate.
* \see binary_negate
* \see not1
*/
template <typename BinaryPredicate>
_CCCL_HOST_DEVICE
CCCL_DEPRECATED_BECAUSE("Use thrust::not_fn instead") binary_negate<BinaryPredicate> not2(const BinaryPredicate& pred);
_CCCL_SUPPRESS_DEPRECATED_POP

namespace detail
{
template <typename F>
Expand Down Expand Up @@ -1367,6 +1240,5 @@ _LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::logical_or);
_LIBCUDACXX_END_NAMESPACE_CUDA
#endif // _CCCL_DOXYGEN_INVOKED

#include <thrust/detail/functional.inl>
#include <thrust/detail/functional/operators.h>
#include <thrust/detail/type_traits/is_commutative.h>

0 comments on commit 609018c

Please sign in to comment.