[libcxx-commits] [libcxx] [libc++] Refactor more __enable_ifs to the canonical style (PR #81457)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 12 01:39:29 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 7f40c5cc4e15a0a67b031f13370afc342a5dc14b c2950d9881ac111eaba023590beda030cd20d2f1 -- libcxx/include/__algorithm/search.h libcxx/include/__algorithm/search_n.h libcxx/include/__functional/reference_wrapper.h libcxx/include/__hash_table libcxx/include/__iterator/advance.h libcxx/include/__iterator/bounded_iter.h libcxx/include/__iterator/move_iterator.h libcxx/include/__iterator/reverse_iterator.h libcxx/include/__memory/allocator_traits.h libcxx/include/__memory/compressed_pair.h libcxx/include/__memory/pointer_traits.h libcxx/include/__memory/shared_ptr.h libcxx/include/__memory/uninitialized_algorithms.h libcxx/include/__random/seed_seq.h libcxx/include/__thread/thread.h libcxx/include/__tree libcxx/include/__utility/pair.h libcxx/include/bitset libcxx/include/deque libcxx/include/experimental/memory libcxx/include/forward_list libcxx/include/future libcxx/include/iomanip libcxx/include/list libcxx/include/map libcxx/include/queue libcxx/include/stack libcxx/include/tuple libcxx/include/unordered_map libcxx/include/vector
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index 2a63800284..275c7e2620 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -206,9 +206,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
}
# if _LIBCPP_STD_VER >= 23
- template <class _U1,
- class _U2,
- __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1&, _U2&>(), int> = 0>
+ template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1&, _U2&>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!_CheckArgs::template __is_implicit<_U1&, _U2&>())
pair(pair<_U1, _U2>& __p) noexcept((is_nothrow_constructible<first_type, _U1&>::value &&
is_nothrow_constructible<second_type, _U2&>::value))
@@ -381,10 +379,9 @@ struct _LIBCPP_TEMPLATE_VIS pair
// pair-like types. This was historically provided as an extension.
# if _LIBCPP_STD_VER < 23
// from std::tuple
- template <
- class _U1,
- class _U2,
- __enable_if_t<is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value, int> = 0>
+ template < class _U1,
+ class _U2,
+ __enable_if_t<is_convertible<_U1 const&, _T1>::value && is_convertible<_U2 const&, _T2>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair(tuple<_U1, _U2> const& __p)
: first(std::get<0>(__p)), second(std::get<1>(__p)) {}
``````````
</details>
https://github.com/llvm/llvm-project/pull/81457
More information about the libcxx-commits
mailing list