Skip to content

Commit e856227

Browse files
authored
Remove some unnecessary clang-format hacks (#3768)
1 parent 45111bb commit e856227

File tree

17 files changed

+138
-186
lines changed

17 files changed

+138
-186
lines changed

stl/inc/__msvc_iter_core.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ template <class>
165165
struct _Iterator_traits_base {};
166166

167167
template <class _It>
168-
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> //
169-
&& _Has_member_reference<_It> && _Has_member_iterator_category<_It>;
168+
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> && _Has_member_reference<_It>
169+
&& _Has_member_iterator_category<_It>;
170170

171171
template <bool _Has_member_typedef>
172172
struct _Old_iter_traits_pointer {

stl/inc/algorithm

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4588,8 +4588,7 @@ namespace ranges {
45884588
concept _Is_input_with_value_type = input_iterator<_It> && same_as<iter_value_t<_It>, _Ty>;
45894589

45904590
template <class _It, class _Out>
4591-
concept _Can_reread_or_store = forward_iterator<_It> //
4592-
|| _Is_input_with_value_type<_Out, iter_value_t<_It>> //
4591+
concept _Can_reread_or_store = forward_iterator<_It> || _Is_input_with_value_type<_Out, iter_value_t<_It>>
45934592
|| indirectly_copyable_storable<_It, _Out>;
45944593

45954594
class _Unique_copy_fn : private _Not_quite_object {
@@ -6324,9 +6323,8 @@ _CONSTEXPR20 void _Push_heap_by_index(
63246323
_RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Top, _Ty&& _Val, _Pr _Pred) {
63256324
// percolate _Hole to _Top or where _Val belongs
63266325
using _Diff = _Iter_diff_t<_RanIt>;
6327-
for (_Diff _Idx = (_Hole - 1) >> 1; // shift for codegen
6328-
_Top < _Hole && _DEBUG_LT_PRED(_Pred, *(_First + _Idx), _Val); //
6329-
_Idx = (_Hole - 1) >> 1) { // shift for codegen
6326+
for (_Diff _Idx = (_Hole - 1) >> 1; // shift for codegen
6327+
_Top < _Hole && _DEBUG_LT_PRED(_Pred, *(_First + _Idx), _Val); _Idx = (_Hole - 1) >> 1) { // shift for codegen
63306328
// move _Hole up to parent
63316329
*(_First + _Hole) = _STD move(*(_First + _Idx));
63326330
_Hole = _Idx;
@@ -10631,9 +10629,9 @@ namespace ranges {
1063110629
using _Memcmp_classification_pred = _Lex_compare_memcmp_classify<_It1, _It2, _Pr>;
1063210630
constexpr bool _Is_sized1 = sized_sentinel_for<_Se1, _It1>;
1063310631
constexpr bool _Is_sized2 = sized_sentinel_for<_Se2, _It2>;
10634-
if constexpr (!is_void_v<_Memcmp_classification_pred> && _Sized_or_unreachable_sentinel_for<_Se1, _It1> //
10635-
&& _Sized_or_unreachable_sentinel_for<_Se2, _It2> //
10636-
&& same_as<_Pj1, identity> && same_as<_Pj2, identity>) {
10632+
if constexpr (!is_void_v<_Memcmp_classification_pred> && _Sized_or_unreachable_sentinel_for<_Se1, _It1>
10633+
&& _Sized_or_unreachable_sentinel_for<_Se2, _It2> && same_as<_Pj1, identity>
10634+
&& same_as<_Pj2, identity>) {
1063710635
if (!_STD is_constant_evaluated()) {
1063810636
size_t _Num1;
1063910637
if constexpr (_Is_sized1) {

stl/inc/chrono

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,12 +2989,10 @@ namespace chrono {
29892989
if constexpr (is_invocable_v<clock_time_conversion<_DestClock, _SourceClock>, _Tp>) {
29902990
return _Clock_cast_strategy::_Direct;
29912991
} else {
2992-
constexpr bool _Has_sys = _Has_two_step_conversion< //
2993-
clock_time_conversion<_DestClock, system_clock>, //
2992+
constexpr bool _Has_sys = _Has_two_step_conversion<clock_time_conversion<_DestClock, system_clock>,
29942993
clock_time_conversion<system_clock, _SourceClock>, _Tp>;
29952994

2996-
constexpr bool _Has_utc = _Has_two_step_conversion< //
2997-
clock_time_conversion<_DestClock, utc_clock>, //
2995+
constexpr bool _Has_utc = _Has_two_step_conversion<clock_time_conversion<_DestClock, utc_clock>,
29982996
clock_time_conversion<utc_clock, _SourceClock>, _Tp>;
29992997

30002998
if constexpr (_Has_sys && _Has_utc) {
@@ -5808,60 +5806,46 @@ struct formatter<_CHRONO duration<_Rep, _Period>, _CharT>
58085806
: _Fill_tm_formatter<_CHRONO duration<_Rep, _Period>, _CharT> {};
58095807

58105808
template <class _CharT>
5811-
struct formatter<_CHRONO day, _CharT> //
5812-
: _Fill_tm_formatter<_CHRONO day, _CharT> {};
5809+
struct formatter<_CHRONO day, _CharT> : _Fill_tm_formatter<_CHRONO day, _CharT> {};
58135810

58145811
template <class _CharT>
5815-
struct formatter<_CHRONO month, _CharT> //
5816-
: _Fill_tm_formatter<_CHRONO month, _CharT> {};
5812+
struct formatter<_CHRONO month, _CharT> : _Fill_tm_formatter<_CHRONO month, _CharT> {};
58175813

58185814
template <class _CharT>
5819-
struct formatter<_CHRONO year, _CharT> //
5820-
: _Fill_tm_formatter<_CHRONO year, _CharT> {};
5815+
struct formatter<_CHRONO year, _CharT> : _Fill_tm_formatter<_CHRONO year, _CharT> {};
58215816

58225817
template <class _CharT>
5823-
struct formatter<_CHRONO weekday, _CharT> //
5824-
: _Fill_tm_formatter<_CHRONO weekday, _CharT> {};
5818+
struct formatter<_CHRONO weekday, _CharT> : _Fill_tm_formatter<_CHRONO weekday, _CharT> {};
58255819

58265820
template <class _CharT>
5827-
struct formatter<_CHRONO weekday_indexed, _CharT> //
5828-
: _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};
5821+
struct formatter<_CHRONO weekday_indexed, _CharT> : _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};
58295822

58305823
template <class _CharT>
5831-
struct formatter<_CHRONO weekday_last, _CharT> //
5832-
: _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};
5824+
struct formatter<_CHRONO weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};
58335825

58345826
template <class _CharT>
5835-
struct formatter<_CHRONO month_day, _CharT> //
5836-
: _Fill_tm_formatter<_CHRONO month_day, _CharT> {};
5827+
struct formatter<_CHRONO month_day, _CharT> : _Fill_tm_formatter<_CHRONO month_day, _CharT> {};
58375828

58385829
template <class _CharT>
5839-
struct formatter<_CHRONO month_day_last, _CharT> //
5840-
: _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};
5830+
struct formatter<_CHRONO month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};
58415831

58425832
template <class _CharT>
5843-
struct formatter<_CHRONO month_weekday, _CharT> //
5844-
: _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};
5833+
struct formatter<_CHRONO month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};
58455834

58465835
template <class _CharT>
5847-
struct formatter<_CHRONO month_weekday_last, _CharT> //
5848-
: _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};
5836+
struct formatter<_CHRONO month_weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};
58495837

58505838
template <class _CharT>
5851-
struct formatter<_CHRONO year_month, _CharT> //
5852-
: _Fill_tm_formatter<_CHRONO year_month, _CharT> {};
5839+
struct formatter<_CHRONO year_month, _CharT> : _Fill_tm_formatter<_CHRONO year_month, _CharT> {};
58535840

58545841
template <class _CharT>
5855-
struct formatter<_CHRONO year_month_day, _CharT> //
5856-
: _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};
5842+
struct formatter<_CHRONO year_month_day, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};
58575843

58585844
template <class _CharT>
5859-
struct formatter<_CHRONO year_month_day_last, _CharT> //
5860-
: _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};
5845+
struct formatter<_CHRONO year_month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};
58615846

58625847
template <class _CharT>
5863-
struct formatter<_CHRONO year_month_weekday, _CharT> //
5864-
: _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};
5848+
struct formatter<_CHRONO year_month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};
58655849

58665850
template <class _CharT>
58675851
struct formatter<_CHRONO year_month_weekday_last, _CharT>
@@ -5872,12 +5856,10 @@ struct formatter<_CHRONO hh_mm_ss<_CHRONO duration<_Rep, _Period>>, _CharT>
58725856
: _Fill_tm_formatter<_CHRONO hh_mm_ss<_CHRONO duration<_Rep, _Period>>, _CharT> {};
58735857

58745858
template <class _CharT>
5875-
struct formatter<_CHRONO sys_info, _CharT> //
5876-
: _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};
5859+
struct formatter<_CHRONO sys_info, _CharT> : _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};
58775860

58785861
template <class _CharT>
5879-
struct formatter<_CHRONO local_info, _CharT> //
5880-
: _Fill_tm_formatter<_CHRONO local_info, _CharT> {};
5862+
struct formatter<_CHRONO local_info, _CharT> : _Fill_tm_formatter<_CHRONO local_info, _CharT> {};
58815863

58825864
template <class _Duration, class _CharT>
58835865
struct formatter<_CHRONO sys_time<_Duration>, _CharT> {
@@ -5966,8 +5948,7 @@ private:
59665948
};
59675949

59685950
template <class _Duration, class _CharT>
5969-
struct formatter<_CHRONO local_time<_Duration>, _CharT> //
5970-
: _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};
5951+
struct formatter<_CHRONO local_time<_Duration>, _CharT> : _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};
59715952

59725953
template <class _Duration, class _CharT>
59735954
struct formatter<_CHRONO _Local_time_format_t<_Duration>, _CharT>

stl/inc/execution

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3883,10 +3883,8 @@ _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs
38833883
const auto _ULast2 = _Get_unwrapped(_Last2);
38843884
auto _UDest = _Get_unwrapped_unverified(_Dest);
38853885
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2, _FwdIt3>;
3886-
if constexpr (remove_reference_t<_ExPo>::_Parallelize //
3887-
&& _Is_ranges_random_iter_v<_FwdIt1> //
3888-
&& _Is_ranges_random_iter_v<_FwdIt2> //
3889-
&& _Is_cpp17_random_iter_v<_FwdIt3>) {
3886+
if constexpr (remove_reference_t<_ExPo>::_Parallelize && _Is_ranges_random_iter_v<_FwdIt1>
3887+
&& _Is_ranges_random_iter_v<_FwdIt2> && _Is_cpp17_random_iter_v<_FwdIt3>) {
38903888
// only parallelize if desired, and all of the iterators given are random access
38913889
const size_t _Hw_threads = __std_parallel_algorithms_hw_threads();
38923890
if (_Hw_threads > 1) { // parallelize on multiprocessor machines
@@ -3975,10 +3973,8 @@ _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2
39753973
const auto _ULast2 = _Get_unwrapped(_Last2);
39763974
auto _UDest = _Get_unwrapped_unverified(_Dest);
39773975
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2, _FwdIt3>;
3978-
if constexpr (remove_reference_t<_ExPo>::_Parallelize //
3979-
&& _Is_ranges_random_iter_v<_FwdIt1> //
3980-
&& _Is_ranges_random_iter_v<_FwdIt2> //
3981-
&& _Is_cpp17_random_iter_v<_FwdIt3>) {
3976+
if constexpr (remove_reference_t<_ExPo>::_Parallelize && _Is_ranges_random_iter_v<_FwdIt1>
3977+
&& _Is_ranges_random_iter_v<_FwdIt2> && _Is_cpp17_random_iter_v<_FwdIt3>) {
39823978
// only parallelize if desired, and all of the iterators given are random access
39833979
const size_t _Hw_threads = __std_parallel_algorithms_hw_threads();
39843980
if (_Hw_threads > 1) { // parallelize on multiprocessor machines

stl/inc/expected

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public:
390390
is_nothrow_copy_constructible_v<_Ty>&& is_nothrow_copy_constructible_v<_Err> //
391391
&& is_nothrow_copy_assignable_v<_Ty>&& is_nothrow_copy_assignable_v<_Err>) // strengthened
392392
requires is_copy_assignable_v<_Ty> && is_copy_constructible_v<_Ty> //
393-
&& is_copy_assignable_v<_Err> && is_copy_constructible_v<_Err> //
393+
&& is_copy_assignable_v<_Err> && is_copy_constructible_v<_Err>
394394
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
395395
{
396396
if (_Has_value && _Other._Has_value) {
@@ -409,9 +409,9 @@ public:
409409

410410
constexpr expected& operator=(expected&& _Other) noexcept(
411411
is_nothrow_move_constructible_v<_Ty>&& is_nothrow_move_constructible_v<_Err> //
412-
&& is_nothrow_move_assignable_v<_Ty>&& is_nothrow_move_assignable_v<_Err>) //
412+
&& is_nothrow_move_assignable_v<_Ty>&& is_nothrow_move_assignable_v<_Err>)
413413
requires is_move_assignable_v<_Ty> && is_move_constructible_v<_Ty> //
414-
&& is_move_assignable_v<_Err> && is_move_constructible_v<_Err> //
414+
&& is_move_assignable_v<_Err> && is_move_constructible_v<_Err>
415415
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
416416
{
417417
if (_Has_value && _Other._Has_value) {
@@ -514,9 +514,9 @@ public:
514514

515515
// [expected.object.swap]
516516
constexpr void swap(expected& _Other) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_swappable_v<_Ty>&&
517-
is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>) //
517+
is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>)
518518
requires is_swappable_v<_Ty> && is_swappable_v<_Err> //
519-
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> //
519+
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err>
520520
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
521521
{
522522
using _STD swap;
@@ -567,9 +567,9 @@ public:
567567
}
568568

569569
friend constexpr void swap(expected& _Lhs, expected& _Rhs) noexcept(is_nothrow_move_constructible_v<_Ty>&&
570-
is_nothrow_swappable_v<_Ty>&& is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>) //
570+
is_nothrow_swappable_v<_Ty>&& is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>)
571571
requires is_swappable_v<_Ty> && is_swappable_v<_Err> //
572-
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> //
572+
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err>
573573
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
574574
{
575575
_Lhs.swap(_Rhs);
@@ -1230,14 +1230,14 @@ public:
12301230

12311231
template <class _UErr>
12321232
requires is_constructible_v<_Err, const _UErr&>
1233-
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) //
1234-
noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
1233+
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) noexcept(
1234+
is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
12351235
: _Unexpected(_Other._Unexpected), _Has_value(false) {}
12361236

12371237
template <class _UErr>
12381238
requires is_constructible_v<_Err, _UErr>
1239-
constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(unexpected<_UErr>&& _Other) //
1240-
noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened
1239+
constexpr explicit(!is_convertible_v<_UErr, _Err>)
1240+
expected(unexpected<_UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened
12411241
: _Unexpected(_STD move(_Other._Unexpected)), _Has_value(false) {}
12421242

12431243
constexpr explicit expected(in_place_t) noexcept : _Has_value(true) {}

stl/inc/memory

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ranges {
9797
constexpr bool _Is_sized1 = sized_sentinel_for<_Se, _It>;
9898
constexpr bool _Is_sized2 = sized_sentinel_for<_OSe, _Out>;
9999
if constexpr (_Iter_copy_cat<_It, _Out>::_Bitcopy_constructible
100-
&& _Sized_or_unreachable_sentinel_for<_Se, _It> //
100+
&& _Sized_or_unreachable_sentinel_for<_Se, _It>
101101
&& _Sized_or_unreachable_sentinel_for<_OSe, _Out>) {
102102
if constexpr (_Is_sized1 && _Is_sized2) {
103103
return _Copy_memcpy_common(_IFirst, _RANGES next(_IFirst, _STD move(_ILast)), _OFirst,
@@ -3344,10 +3344,8 @@ public:
33443344

33453345
template <class _Uty, class _Is_nullptr = is_same<_Uty, nullptr_t>>
33463346
using _Enable_ctor_reset =
3347-
enable_if_t<is_same_v<_Uty, pointer> //
3348-
|| _Is_nullptr::value //
3349-
|| (is_same_v<pointer, element_type*> //
3350-
&& is_pointer_v<_Uty> //
3347+
enable_if_t<is_same_v<_Uty, pointer> || _Is_nullptr::value
3348+
|| (is_same_v<pointer, element_type*> && is_pointer_v<_Uty>
33513349
&& is_convertible_v<remove_pointer_t<_Uty> (*)[], element_type (*)[]>),
33523350
int>;
33533351

0 commit comments

Comments
 (0)