Skip to content

Commit

Permalink
Deprecate thrust logical meta functions (#3538)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber authored Jan 28, 2025
1 parent 28974d0 commit 0b5844f
Showing 1 changed file with 10 additions and 47 deletions.
57 changes: 10 additions & 47 deletions thrust/thrust/type_traits/logical_metafunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@

THRUST_NAMESPACE_BEGIN

//! \addtogroup utility
//! \{
//! \addtogroup type_traits Type Traits
//! \{

using ::cuda::std::conjunction;
using ::cuda::std::disjunction;
using ::cuda::std::negation;
Expand All @@ -46,64 +41,32 @@ using ::cuda::std::disjunction_v;
using ::cuda::std::negation_v;
#endif // !_CCCL_NO_VARIABLE_TEMPLATES

//! \brief <a href="https://en.cppreference.com/w/cpp/types/integral_constant"><tt>std::integral_constant</tt></a>
//! whose value is <tt>(... && Bs)</tt>.
//!
//! \see conjunction_value_v
//! \see conjunction
//! \see <a href="https://en.cppreference.com/w/cpp/types/conjunction"><tt>std::conjunction</tt></a>
template <bool... Bs>
using conjunction_value = conjunction<::cuda::std::bool_constant<Bs>...>;
using conjunction_value CCCL_DEPRECATED_BECAUSE("Use: cuda::std::bool_constant<(Bs && ...)>") =
conjunction<::cuda::std::bool_constant<Bs>...>;

#if _CCCL_STD_VER >= 2014
//! \brief <tt>constexpr bool</tt> whose value is <tt>(... && Bs)</tt>.
//!
//! \see conjunction_value
//! \see conjunction
//! \see <a href="https://en.cppreference.com/w/cpp/types/conjunction"><tt>std::conjunction</tt></a>
template <bool... Bs>
constexpr bool conjunction_value_v = conjunction_value<Bs...>::value;
constexpr bool
conjunction_value_v CCCL_DEPRECATED_BECAUSE("Use a fold expression: Bs && ...") = conjunction_value<Bs...>::value;
#endif

//! \brief <a href="https://en.cppreference.com/w/cpp/types/integral_constant"><tt>std::integral_constant</tt></a>
//! whose value is <tt>(... || Bs)</tt>.
//!
//! \see disjunction_value_v
//! \see disjunction
//! \see <a href="https://en.cppreference.com/w/cpp/types/disjunction"><tt>std::disjunction</tt></a>
template <bool... Bs>
using disjunction_value = disjunction<::cuda::std::bool_constant<Bs>...>;
using disjunction_value CCCL_DEPRECATED_BECAUSE("Use: cuda::std::bool_constant<(Bs || ...)>") =
disjunction<::cuda::std::bool_constant<Bs>...>;

#if _CCCL_STD_VER >= 2014
//! \brief <tt>constexpr bool</tt> whose value is <tt>(... || Bs)</tt>.
//!
//! \see disjunction_value
//! \see disjunction
//! \see <a href="https://en.cppreference.com/w/cpp/types/disjunction"><tt>std::disjunction</tt></a>
template <bool... Bs>
constexpr bool disjunction_value_v = disjunction_value<Bs...>::value;
constexpr bool
disjunction_value_v CCCL_DEPRECATED_BECAUSE("Use a fold expression: Bs || ...") = disjunction_value<Bs...>::value;
#endif

//! \brief <a href="https://en.cppreference.com/w/cpp/types/integral_constant"><tt>std::integral_constant</tt></a>
//! whose value is <tt>!Bs</tt>.
//!
//! \see negation_value_v
//! \see negation
//! \see <a href="https://en.cppreference.com/w/cpp/types/negation"><tt>std::negation</tt></a>
template <bool B>
using negation_value = ::cuda::std::bool_constant<!B>;
using negation_value CCCL_DEPRECATED_BECAUSE("Use cuda::std::bool_constant<!B>") = ::cuda::std::bool_constant<!B>;

#if _CCCL_STD_VER >= 2014
//! \brief <tt>constexpr bool</tt> whose value is <tt>!Ts::value</tt>.
//!
//! \see negation_value
//! \see negation
//! \see <a href="https://en.cppreference.com/w/cpp/types/negation"><tt>std::negation</tt></a>
template <bool B>
constexpr bool negation_value_v = negation_value<B>::value;
constexpr bool negation_value_v CCCL_DEPRECATED_BECAUSE("Use a plain negation !B") = negation_value<B>::value;
#endif

//! \} // type traits
//! \} // utility

THRUST_NAMESPACE_END

0 comments on commit 0b5844f

Please sign in to comment.