Skip to content

Commit 0b34753

Browse files
committed
[libc++] Remove _Lazy
1 parent eae020b commit 0b34753

7 files changed

Lines changed: 28 additions & 65 deletions

File tree

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,6 @@ set(files
898898
__type_traits/is_void.h
899899
__type_traits/is_volatile.h
900900
__type_traits/is_within_lifetime.h
901-
__type_traits/lazy.h
902901
__type_traits/make_32_64_or_128_bit.h
903902
__type_traits/make_const_lvalue_ref.h
904903
__type_traits/make_signed.h

libcxx/include/__expected/expected.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <__type_traits/is_trivially_destructible.h>
3838
#include <__type_traits/is_trivially_relocatable.h>
3939
#include <__type_traits/is_void.h>
40-
#include <__type_traits/lazy.h>
4140
#include <__type_traits/negation.h>
4241
#include <__type_traits/remove_cv.h>
4342
#include <__type_traits/remove_cvref.h>
@@ -685,12 +684,11 @@ class expected : private __expected_base<_Tp, _Err> {
685684
private:
686685
template <class _OtherErrQual>
687686
static constexpr bool __can_assign_from_unexpected =
688-
_And< is_constructible<_Err, _OtherErrQual>,
689-
is_assignable<_Err&, _OtherErrQual>,
690-
_Lazy<_Or,
691-
is_nothrow_constructible<_Err, _OtherErrQual>,
692-
is_nothrow_move_constructible<_Tp>,
693-
is_nothrow_move_constructible<_Err>> >::value;
687+
_And<is_constructible<_Err, _OtherErrQual>,
688+
is_assignable<_Err&, _OtherErrQual>,
689+
_Or<is_nothrow_constructible<_Err, _OtherErrQual>,
690+
is_nothrow_move_constructible<_Tp>,
691+
is_nothrow_move_constructible<_Err>>>::value;
694692

695693
public:
696694
template <class _OtherErr>

libcxx/include/__type_traits/conjunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ false_type __and_helper(...);
3434
//
3535
// However, `_And<_Pred...>` itself will evaluate its result immediately (without having to
3636
// be instantiated) since it is an alias, unlike `conjunction<_Pred...>`, which is a struct.
37-
// If you want to defer the evaluation of `_And<_Pred...>` itself, use `_Lazy<_And, _Pred...>`.
37+
// If you want to defer the evaluation, use `conjunction{,_v}<_Pred...>`.
3838
template <class... _Pred>
3939
using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
4040

libcxx/include/__type_traits/disjunction.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ struct _OrImpl<false> {
3838
//
3939
// However, `_Or<_Pred...>` itself will evaluate its result immediately (without having to
4040
// be instantiated) since it is an alias, unlike `disjunction<_Pred...>`, which is a struct.
41-
// If you want to defer the evaluation of `_Or<_Pred...>` itself, use `_Lazy<_Or, _Pred...>`
42-
// or `disjunction<_Pred...>` directly.
41+
// If you want to defer the evaluation , use `disjunction{,_v}<_Pred...>`.
4342
template <class... _Args>
4443
using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
4544

libcxx/include/__type_traits/lazy.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

libcxx/include/module.modulemap.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ module std_core [system] {
333333
export std_core.type_traits.integral_constant
334334
}
335335
module is_within_lifetime { header "__type_traits/is_within_lifetime.h" }
336-
module lazy { header "__type_traits/lazy.h" }
337336
module make_32_64_or_128_bit { header "__type_traits/make_32_64_or_128_bit.h" }
338337
module make_const_lvalue_ref { header "__type_traits/make_const_lvalue_ref.h" }
339338
module make_signed { header "__type_traits/make_signed.h" }

libcxx/include/tuple

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ template <class... Types>
255255
# include <__type_traits/is_same.h>
256256
# include <__type_traits/is_swappable.h>
257257
# include <__type_traits/is_trivially_relocatable.h>
258-
# include <__type_traits/lazy.h>
259258
# include <__type_traits/maybe_const.h>
260259
# include <__type_traits/nat.h>
261260
# include <__type_traits/negation.h>
@@ -597,30 +596,28 @@ public:
597596
template <template <class...> class _IsImpDefault = __is_implicitly_default_constructible,
598597
template <class...> class _IsDefault = is_default_constructible,
599598
__enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
600-
_LIBCPP_HIDE_FROM_ABI constexpr explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)
599+
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<_IsImpDefault<_Tp>...>::value)
601600
tuple() noexcept(_And<is_nothrow_default_constructible<_Tp>...>::value) {}
602601

603602
template <class _Alloc,
604603
template <class...> class _IsImpDefault = __is_implicitly_default_constructible,
605604
template <class...> class _IsDefault = is_default_constructible,
606605
__enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
607-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)
608-
tuple(allocator_arg_t, _Alloc const& __a)
606+
_LIBCPP_HIDE_FROM_ABI
607+
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<_IsImpDefault<_Tp>...>::value) tuple(allocator_arg_t, _Alloc const& __a)
609608
: __base_(allocator_arg_t(), __a, __value_init{}) {}
610609

611610
// tuple(const T&...) constructors (including allocator_arg_t variants)
612611
template <template <class...> class _And = _And,
613612
__enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
614-
_LIBCPP_HIDE_FROM_ABI
615-
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
613+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<const _Tp&, _Tp>...>::value)
616614
tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)
617615
: __base_(__forward_args{}, __t...) {}
618616

619617
template <class _Alloc,
620618
template <class...> class _And = _And,
621619
__enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
622-
_LIBCPP_HIDE_FROM_ABI
623-
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
620+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<const _Tp&, _Tp>...>::value)
624621
tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)
625622
: __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}
626623

@@ -639,15 +636,15 @@ public:
639636
template <class... _Up,
640637
__enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
641638
int> = 0>
642-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
639+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
643640
tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
644641
: __base_(__forward_args{}, std::forward<_Up>(__u)...) {}
645642

646643
template <class _Alloc,
647644
class... _Up,
648645
__enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
649646
int> = 0>
650-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
647+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
651648
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
652649
: __base_(allocator_arg_t(), __a, __forward_args{}, std::forward<_Up>(__u)...) {}
653650

@@ -685,67 +682,63 @@ public:
685682
_Not<is_same<_OtherTuple, const tuple&> >,
686683
_Not<is_same<_OtherTuple, tuple&&> >,
687684
is_constructible<_Tp, __copy_cvref_t<_OtherTuple, _Up> >...,
688-
_Lazy<_Or,
689-
_BoolConstant<sizeof...(_Tp) != 1>,
690-
// _Tp and _Up are 1-element packs - the pack expansions look
691-
// weird to avoid tripping up the type traits in degenerate cases
692-
_Lazy<_And,
693-
_Not<is_same<_Tp, _Up> >...,
694-
_Not<is_convertible<_OtherTuple, _Tp> >...,
695-
_Not<is_constructible<_Tp, _OtherTuple> >... > > > {};
685+
_Or<_BoolConstant<sizeof...(_Tp) != 1>,
686+
// _Tp and _Up are 1-element packs - the pack expansions look
687+
// weird to avoid tripping up the type traits in degenerate cases
688+
_And<_Not<is_same<_Tp, _Up> >...,
689+
_Not<is_convertible<_OtherTuple, _Tp> >...,
690+
_Not<is_constructible<_Tp, _OtherTuple> >... > > > {};
696691

697692
template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>
698-
_LIBCPP_HIDE_FROM_ABI
699-
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
693+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<const _Up&, _Tp>...>::value)
700694
tuple(const tuple<_Up...>& __t) noexcept(_And<is_nothrow_constructible<_Tp, const _Up&>...>::value)
701695
: __base_(__from_tuple(), __t) {}
702696

703697
template <class... _Up,
704698
class _Alloc,
705699
__enable_if_t< _And< _EnableCtorFromUTypesTuple<const tuple<_Up...>&> >::value, int> = 0>
706-
_LIBCPP_HIDE_FROM_ABI
707-
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Up&, _Tp>...> >::value)
700+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<const _Up&, _Tp>...>::value)
708701
tuple(allocator_arg_t, const _Alloc& __a, const tuple<_Up...>& __t)
709702
: __base_(allocator_arg_t(), __a, __from_tuple(), __t) {}
710703

711704
# if _LIBCPP_STD_VER >= 23
712705
// tuple(tuple<U...>&) constructors (including allocator_arg_t variants)
713706

714707
template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
715-
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)
708+
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<_Up&, _Tp>...>::value) tuple(tuple<_Up...>& __t)
716709
: __base_(__from_tuple(), __t) {}
717710

718711
template <class _Alloc, class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<tuple<_Up...>&>::value>* = nullptr>
719-
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<_Up&, _Tp>...>::value)
712+
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<_Up&, _Tp>...>::value)
720713
tuple(allocator_arg_t, const _Alloc& __alloc, tuple<_Up...>& __t)
721714
: __base_(allocator_arg_t(), __alloc, __from_tuple(), __t) {}
722715
# endif // _LIBCPP_STD_VER >= 23
723716

724717
// tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
725718
template <class... _Up, __enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
726-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
719+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
727720
tuple(tuple<_Up...>&& __t) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
728721
: __base_(__from_tuple(), std::move(__t)) {}
729722

730723
template <class _Alloc,
731724
class... _Up,
732725
__enable_if_t< _And< _EnableCtorFromUTypesTuple<tuple<_Up...>&&> >::value, int> = 0>
733-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
726+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!_And<is_convertible<_Up, _Tp>...>::value)
734727
tuple(allocator_arg_t, const _Alloc& __a, tuple<_Up...>&& __t)
735728
: __base_(allocator_arg_t(), __a, __from_tuple(), std::move(__t)) {}
736729

737730
# if _LIBCPP_STD_VER >= 23
738731
// tuple(const tuple<U...>&&) constructors (including allocator_arg_t variants)
739732

740733
template <class... _Up, enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
741-
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
734+
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<const _Up&&, _Tp>...>::value)
742735
tuple(const tuple<_Up...>&& __t)
743736
: __base_(__from_tuple(), std::move(__t)) {}
744737

745738
template <class _Alloc,
746739
class... _Up,
747740
enable_if_t< _EnableCtorFromUTypesTuple<const tuple<_Up...>&&>::value>* = nullptr>
748-
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_Lazy<_And, is_convertible<const _Up&&, _Tp>...>::value)
741+
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_And<is_convertible<const _Up&&, _Tp>...>::value)
749742
tuple(allocator_arg_t, const _Alloc& __alloc, const tuple<_Up...>&& __t)
750743
: __base_(allocator_arg_t(), __alloc, __from_tuple(), std::move(__t)) {}
751744
# endif // _LIBCPP_STD_VER >= 23

0 commit comments

Comments
 (0)