Skip to content

Commit b426e8d

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

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libcxx/include/__algorithm/fill_n.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)