File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
libcxx/include/__type_traits Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ __expand_to_true<__enable_if_t<_Pred::value>...> __and_helper(int);
29
29
template <class ...>
30
30
false_type __and_helper (...);
31
31
32
+ // _And always performs lazy evaluation of its arguments.
33
+ //
34
+ // However, `_And<_Pred...>` itself will evaluate its result immediately (without having to
35
+ // be instantiated) since it is an alias, unlike `conjunction<_Pred...>`, which is a struct.
36
+ // If you want to defer the evaluation of `_And<_Pred...>` itself, use `_Lazy<_And, _Pred...>`.
32
37
template <class ... _Pred>
33
38
using _And _LIBCPP_NODEBUG = decltype (__and_helper<_Pred...>(0 ));
34
39
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ struct _OrImpl<false> {
34
34
using _Result = _Res;
35
35
};
36
36
37
+ // _Or always performs lazy evaluation of its arguments.
38
+ //
39
+ // However, `_Or<_Pred...>` itself will evaluate its result immediately (without having to
40
+ // 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.
37
43
template <class ... _Args>
38
44
using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof ...(_Args) != 0 >::template _Result<false_type, _Args...>;
39
45
You can’t perform that action at this time.
0 commit comments