Skip to content

Commit f780dcc

Browse files
committed
Improve readability of SFINAE for std::__fill_n
1 parent cb5382d commit f780dcc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

libcxx/include/__algorithm/fill_n.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <__iterator/iterator_traits.h>
1717
#include <__iterator/segmented_iterator.h>
1818
#include <__memory/pointer_traits.h>
19-
#include <__type_traits/disjunction.h>
19+
#include <__type_traits/conjunction.h>
2020
#include <__type_traits/enable_if.h>
2121
#include <__type_traits/negation.h>
2222
#include <__utility/convert_to_integral.h>
@@ -37,8 +37,8 @@ template <class _OutputIterator,
3737
class _Tp
3838
#ifndef _LIBCPP_CXX03_LANG
3939
,
40-
__enable_if_t<_Or< _Not<__is_segmented_iterator<_OutputIterator> >,
41-
_Not<__has_random_access_local_iterator<_OutputIterator> > >::value,
40+
__enable_if_t<!_And<__is_segmented_iterator<_OutputIterator>,
41+
__has_random_access_local_iterator<_OutputIterator> >::value,
4242
int> = 0
4343
#endif
4444
>
@@ -53,9 +53,8 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {
5353
template < class _OutputIterator,
5454
class _Size,
5555
class _Tp,
56-
__enable_if_t<__is_segmented_iterator<_OutputIterator>::value &&
57-
__has_random_access_iterator_category<
58-
typename __segmented_iterator_traits<_OutputIterator>::__local_iterator>::value,
56+
__enable_if_t<_And<__is_segmented_iterator<_OutputIterator>,
57+
__has_random_access_local_iterator<_OutputIterator> >::value,
5958
int> = 0>
6059
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _OutputIterator
6160
__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value) {

0 commit comments

Comments
 (0)