Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove _CCCL_NO_FOLD_EXPRESSIONS #4189

Merged
merged 5 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions libcudacxx/include/cuda/std/__cccl/dialect.h
Original file line number Diff line number Diff line change
@@ -80,11 +80,6 @@
# define _CCCL_NO_CONCEPTS
#endif // _CCCL_STD_VER <= 2017 || __cpp_concepts < 201907L

// Fold expressions are only available from C++17 onwards
#if __cpp_fold_expressions < 201603L
# define _CCCL_NO_FOLD_EXPRESSIONS
#endif // __cpp_fold_expressions < 201603L

// Inline variables are only available from C++17 onwards
#if __cpp_inline_variables < 201606L
# define _CCCL_NO_INLINE_VARIABLES
26 changes: 0 additions & 26 deletions libcudacxx/include/cuda/std/__type_traits/fold.h
Original file line number Diff line number Diff line change
@@ -21,13 +21,9 @@
#endif // no system header

#include <cuda/std/__type_traits/integral_constant.h>
#include <cuda/std/__type_traits/is_same.h>
#include <cuda/std/__type_traits/negation.h>

_LIBCUDACXX_BEGIN_NAMESPACE_STD

#if !defined(_CCCL_NO_FOLD_EXPRESSIONS)

// Use fold expressions when possible to implement __fold_and[_v] and
// __fold_or[_v].
template <bool... _Preds>
@@ -42,28 +38,6 @@ using __fold_and = bool_constant<bool((_Preds && ...))>; // cast to bool to avoi
template <bool... _Preds>
using __fold_or = bool_constant<bool((_Preds || ...))>; // cast to bool to avoid error from gcc < 8

#else // ^^^ !_CCCL_NO_FOLD_EXPRESSIONS / _CCCL_NO_FOLD_EXPRESSIONS vvv

// Otherwise, we can use a helper class to implement __fold_and and __fold_or.
template <bool... _Preds>
struct __fold_helper;

template <bool... _Preds>
using __fold_and = _IsSame<__fold_helper<true, _Preds...>, __fold_helper<_Preds..., true>>;

template <bool... _Preds>
using __fold_or = _Not<_IsSame<__fold_helper<false, _Preds...>, __fold_helper<_Preds..., false>>>;

# if !defined(_CCCL_NO_VARIABLE_TEMPLATES)
template <bool... _Preds>
inline constexpr bool __fold_and_v = __fold_and<_Preds...>::value;

template <bool... _Preds>
inline constexpr bool __fold_or_v = __fold_or<_Preds...>::value;
# endif // !_CCCL_NO_VARIABLE_TEMPLATES

#endif // _CCCL_NO_FOLD_EXPRESSIONS

_LIBCUDACXX_END_NAMESPACE_STD

#endif // _LIBCUDACXX___TYPE_TRAITS_FOLD_H
1 change: 1 addition & 0 deletions libcudacxx/include/cuda/std/__type_traits/type_set.h
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
#include <cuda/std/__type_traits/fold.h>
#include <cuda/std/__type_traits/integral_constant.h>
#include <cuda/std/__type_traits/is_base_of.h>
#include <cuda/std/__type_traits/is_same.h>
#include <cuda/std/__type_traits/type_identity.h>
#include <cuda/std/cstddef>

Loading