Skip to content

Commit 3ab1910

Browse files
committed
Remove some unnecessary clang-format hacks
1 parent c8d1efb commit 3ab1910

File tree

18 files changed

+140
-189
lines changed

18 files changed

+140
-189
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: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ namespace chrono {
16011601

16021602
constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {}
16031603
constexpr explicit hh_mm_ss(_Duration _Dur)
1604-
: _Is_neg{_Dur < _Duration::zero()}, //
1604+
: _Is_neg{_Dur < _Duration::zero()},
16051605
_Hours{_Duration_cast_underflow_to_zero<_CHRONO hours>(_CHRONO abs(_Dur))},
16061606
_Mins{_Duration_cast_underflow_to_zero<_CHRONO minutes>(
16071607
_Remove_duration_part<_CHRONO hours>(_CHRONO abs(_Dur)))},
@@ -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) {
@@ -5816,60 +5814,46 @@ struct formatter<_CHRONO duration<_Rep, _Period>, _CharT>
58165814
: _Fill_tm_formatter<_CHRONO duration<_Rep, _Period>, _CharT> {};
58175815

58185816
template <class _CharT>
5819-
struct formatter<_CHRONO day, _CharT> //
5820-
: _Fill_tm_formatter<_CHRONO day, _CharT> {};
5817+
struct formatter<_CHRONO day, _CharT> : _Fill_tm_formatter<_CHRONO day, _CharT> {};
58215818

58225819
template <class _CharT>
5823-
struct formatter<_CHRONO month, _CharT> //
5824-
: _Fill_tm_formatter<_CHRONO month, _CharT> {};
5820+
struct formatter<_CHRONO month, _CharT> : _Fill_tm_formatter<_CHRONO month, _CharT> {};
58255821

58265822
template <class _CharT>
5827-
struct formatter<_CHRONO year, _CharT> //
5828-
: _Fill_tm_formatter<_CHRONO year, _CharT> {};
5823+
struct formatter<_CHRONO year, _CharT> : _Fill_tm_formatter<_CHRONO year, _CharT> {};
58295824

58305825
template <class _CharT>
5831-
struct formatter<_CHRONO weekday, _CharT> //
5832-
: _Fill_tm_formatter<_CHRONO weekday, _CharT> {};
5826+
struct formatter<_CHRONO weekday, _CharT> : _Fill_tm_formatter<_CHRONO weekday, _CharT> {};
58335827

58345828
template <class _CharT>
5835-
struct formatter<_CHRONO weekday_indexed, _CharT> //
5836-
: _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};
5829+
struct formatter<_CHRONO weekday_indexed, _CharT> : _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};
58375830

58385831
template <class _CharT>
5839-
struct formatter<_CHRONO weekday_last, _CharT> //
5840-
: _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};
5832+
struct formatter<_CHRONO weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};
58415833

58425834
template <class _CharT>
5843-
struct formatter<_CHRONO month_day, _CharT> //
5844-
: _Fill_tm_formatter<_CHRONO month_day, _CharT> {};
5835+
struct formatter<_CHRONO month_day, _CharT> : _Fill_tm_formatter<_CHRONO month_day, _CharT> {};
58455836

58465837
template <class _CharT>
5847-
struct formatter<_CHRONO month_day_last, _CharT> //
5848-
: _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};
5838+
struct formatter<_CHRONO month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};
58495839

58505840
template <class _CharT>
5851-
struct formatter<_CHRONO month_weekday, _CharT> //
5852-
: _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};
5841+
struct formatter<_CHRONO month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};
58535842

58545843
template <class _CharT>
5855-
struct formatter<_CHRONO month_weekday_last, _CharT> //
5856-
: _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};
5844+
struct formatter<_CHRONO month_weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};
58575845

58585846
template <class _CharT>
5859-
struct formatter<_CHRONO year_month, _CharT> //
5860-
: _Fill_tm_formatter<_CHRONO year_month, _CharT> {};
5847+
struct formatter<_CHRONO year_month, _CharT> : _Fill_tm_formatter<_CHRONO year_month, _CharT> {};
58615848

58625849
template <class _CharT>
5863-
struct formatter<_CHRONO year_month_day, _CharT> //
5864-
: _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};
5850+
struct formatter<_CHRONO year_month_day, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};
58655851

58665852
template <class _CharT>
5867-
struct formatter<_CHRONO year_month_day_last, _CharT> //
5868-
: _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};
5853+
struct formatter<_CHRONO year_month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};
58695854

58705855
template <class _CharT>
5871-
struct formatter<_CHRONO year_month_weekday, _CharT> //
5872-
: _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};
5856+
struct formatter<_CHRONO year_month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};
58735857

58745858
template <class _CharT>
58755859
struct formatter<_CHRONO year_month_weekday_last, _CharT>
@@ -5880,12 +5864,10 @@ struct formatter<_CHRONO hh_mm_ss<_CHRONO duration<_Rep, _Period>>, _CharT>
58805864
: _Fill_tm_formatter<_CHRONO hh_mm_ss<_CHRONO duration<_Rep, _Period>>, _CharT> {};
58815865

58825866
template <class _CharT>
5883-
struct formatter<_CHRONO sys_info, _CharT> //
5884-
: _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};
5867+
struct formatter<_CHRONO sys_info, _CharT> : _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};
58855868

58865869
template <class _CharT>
5887-
struct formatter<_CHRONO local_info, _CharT> //
5888-
: _Fill_tm_formatter<_CHRONO local_info, _CharT> {};
5870+
struct formatter<_CHRONO local_info, _CharT> : _Fill_tm_formatter<_CHRONO local_info, _CharT> {};
58895871

58905872
template <class _Duration, class _CharT>
58915873
struct formatter<_CHRONO sys_time<_Duration>, _CharT> {
@@ -5974,8 +5956,7 @@ private:
59745956
};
59755957

59765958
template <class _Duration, class _CharT>
5977-
struct formatter<_CHRONO local_time<_Duration>, _CharT> //
5978-
: _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};
5959+
struct formatter<_CHRONO local_time<_Duration>, _CharT> : _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};
59795960

59805961
template <class _Duration, class _CharT>
59815962
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);
@@ -1221,14 +1221,14 @@ public:
12211221

12221222
template <class _UErr>
12231223
requires is_constructible_v<_Err, const _UErr&>
1224-
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) //
1225-
noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
1224+
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) noexcept(
1225+
is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
12261226
: _Unexpected(_Other._Unexpected), _Has_value(false) {}
12271227

12281228
template <class _UErr>
12291229
requires is_constructible_v<_Err, _UErr>
1230-
constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(unexpected<_UErr>&& _Other) //
1231-
noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened
1230+
constexpr explicit(!is_convertible_v<_UErr, _Err>)
1231+
expected(unexpected<_UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened
12321232
: _Unexpected(_STD move(_Other._Unexpected)), _Has_value(false) {}
12331233

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

stl/inc/format

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,8 +2753,7 @@ _NODISCARD _OutputIt _Write_integral(
27532753

27542754
if (_Separators > 0) {
27552755
return _Write_separated_integer(_Buffer_start, _End, _Groups,
2756-
_STD use_facet<numpunct<_CharT>>(_Locale._Get()).thousands_sep(), //
2757-
_Separators, _STD move(_Out));
2756+
_STD use_facet<numpunct<_CharT>>(_Locale._Get()).thousands_sep(), _Separators, _STD move(_Out));
27582757
}
27592758
return _Widen_and_copy<_CharT>(_Buffer_start, _End, _STD move(_Out));
27602759
};

stl/inc/memory

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

33493349
template <class _Uty, class _Is_nullptr = is_same<_Uty, nullptr_t>>
33503350
using _Enable_ctor_reset =
3351-
enable_if_t<is_same_v<_Uty, pointer> //
3352-
|| _Is_nullptr::value //
3353-
|| (is_same_v<pointer, element_type*> //
3354-
&& is_pointer_v<_Uty> //
3351+
enable_if_t<is_same_v<_Uty, pointer> || _Is_nullptr::value
3352+
|| (is_same_v<pointer, element_type*> && is_pointer_v<_Uty>
33553353
&& is_convertible_v<remove_pointer_t<_Uty> (*)[], element_type (*)[]>),
33563354
int>;
33573355

0 commit comments

Comments
 (0)