Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unnecessary clang-format hacks #3768

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ template <class>
struct _Iterator_traits_base {};

template <class _It>
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> //
&& _Has_member_reference<_It> && _Has_member_iterator_category<_It>;
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> && _Has_member_reference<_It>
&& _Has_member_iterator_category<_It>;

template <bool _Has_member_typedef>
struct _Old_iter_traits_pointer {
Expand Down
14 changes: 6 additions & 8 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -4588,8 +4588,7 @@ namespace ranges {
concept _Is_input_with_value_type = input_iterator<_It> && same_as<iter_value_t<_It>, _Ty>;

template <class _It, class _Out>
concept _Can_reread_or_store = forward_iterator<_It> //
|| _Is_input_with_value_type<_Out, iter_value_t<_It>> //
concept _Can_reread_or_store = forward_iterator<_It> || _Is_input_with_value_type<_Out, iter_value_t<_It>>
|| indirectly_copyable_storable<_It, _Out>;

class _Unique_copy_fn : private _Not_quite_object {
Expand Down Expand Up @@ -6324,9 +6323,8 @@ _CONSTEXPR20 void _Push_heap_by_index(
_RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Top, _Ty&& _Val, _Pr _Pred) {
// percolate _Hole to _Top or where _Val belongs
using _Diff = _Iter_diff_t<_RanIt>;
for (_Diff _Idx = (_Hole - 1) >> 1; // shift for codegen
_Top < _Hole && _DEBUG_LT_PRED(_Pred, *(_First + _Idx), _Val); //
_Idx = (_Hole - 1) >> 1) { // shift for codegen
for (_Diff _Idx = (_Hole - 1) >> 1; // shift for codegen
_Top < _Hole && _DEBUG_LT_PRED(_Pred, *(_First + _Idx), _Val); _Idx = (_Hole - 1) >> 1) { // shift for codegen
// move _Hole up to parent
*(_First + _Hole) = _STD move(*(_First + _Idx));
_Hole = _Idx;
Expand Down Expand Up @@ -10631,9 +10629,9 @@ namespace ranges {
using _Memcmp_classification_pred = _Lex_compare_memcmp_classify<_It1, _It2, _Pr>;
constexpr bool _Is_sized1 = sized_sentinel_for<_Se1, _It1>;
constexpr bool _Is_sized2 = sized_sentinel_for<_Se2, _It2>;
if constexpr (!is_void_v<_Memcmp_classification_pred> && _Sized_or_unreachable_sentinel_for<_Se1, _It1> //
&& _Sized_or_unreachable_sentinel_for<_Se2, _It2> //
&& same_as<_Pj1, identity> && same_as<_Pj2, identity>) {
if constexpr (!is_void_v<_Memcmp_classification_pred> && _Sized_or_unreachable_sentinel_for<_Se1, _It1>
&& _Sized_or_unreachable_sentinel_for<_Se2, _It2> && same_as<_Pj1, identity>
&& same_as<_Pj2, identity>) {
if (!_STD is_constant_evaluated()) {
size_t _Num1;
if constexpr (_Is_sized1) {
Expand Down
59 changes: 20 additions & 39 deletions stl/inc/chrono
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ namespace chrono {

constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {}
constexpr explicit hh_mm_ss(_Duration _Dur)
: _Is_neg{_Dur < _Duration::zero()}, //
: _Is_neg{_Dur < _Duration::zero()},
_Hours{_Duration_cast_underflow_to_zero<_CHRONO hours>(_CHRONO abs(_Dur))},
_Mins{_Duration_cast_underflow_to_zero<_CHRONO minutes>(
_Remove_duration_part<_CHRONO hours>(_CHRONO abs(_Dur)))},
Expand Down Expand Up @@ -2989,12 +2989,10 @@ namespace chrono {
if constexpr (is_invocable_v<clock_time_conversion<_DestClock, _SourceClock>, _Tp>) {
return _Clock_cast_strategy::_Direct;
} else {
constexpr bool _Has_sys = _Has_two_step_conversion< //
clock_time_conversion<_DestClock, system_clock>, //
constexpr bool _Has_sys = _Has_two_step_conversion<clock_time_conversion<_DestClock, system_clock>,
clock_time_conversion<system_clock, _SourceClock>, _Tp>;

constexpr bool _Has_utc = _Has_two_step_conversion< //
clock_time_conversion<_DestClock, utc_clock>, //
constexpr bool _Has_utc = _Has_two_step_conversion<clock_time_conversion<_DestClock, utc_clock>,
clock_time_conversion<utc_clock, _SourceClock>, _Tp>;

if constexpr (_Has_sys && _Has_utc) {
Expand Down Expand Up @@ -5816,60 +5814,46 @@ struct formatter<_CHRONO duration<_Rep, _Period>, _CharT>
: _Fill_tm_formatter<_CHRONO duration<_Rep, _Period>, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO day, _CharT> //
: _Fill_tm_formatter<_CHRONO day, _CharT> {};
struct formatter<_CHRONO day, _CharT> : _Fill_tm_formatter<_CHRONO day, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO month, _CharT> //
: _Fill_tm_formatter<_CHRONO month, _CharT> {};
struct formatter<_CHRONO month, _CharT> : _Fill_tm_formatter<_CHRONO month, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO year, _CharT> //
: _Fill_tm_formatter<_CHRONO year, _CharT> {};
struct formatter<_CHRONO year, _CharT> : _Fill_tm_formatter<_CHRONO year, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO weekday, _CharT> //
: _Fill_tm_formatter<_CHRONO weekday, _CharT> {};
struct formatter<_CHRONO weekday, _CharT> : _Fill_tm_formatter<_CHRONO weekday, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO weekday_indexed, _CharT> //
: _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};
struct formatter<_CHRONO weekday_indexed, _CharT> : _Fill_tm_formatter<_CHRONO weekday_indexed, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO weekday_last, _CharT> //
: _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};
struct formatter<_CHRONO weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO weekday_last, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO month_day, _CharT> //
: _Fill_tm_formatter<_CHRONO month_day, _CharT> {};
struct formatter<_CHRONO month_day, _CharT> : _Fill_tm_formatter<_CHRONO month_day, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO month_day_last, _CharT> //
: _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};
struct formatter<_CHRONO month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO month_day_last, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO month_weekday, _CharT> //
: _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};
struct formatter<_CHRONO month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO month_weekday_last, _CharT> //
: _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};
struct formatter<_CHRONO month_weekday_last, _CharT> : _Fill_tm_formatter<_CHRONO month_weekday_last, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO year_month, _CharT> //
: _Fill_tm_formatter<_CHRONO year_month, _CharT> {};
struct formatter<_CHRONO year_month, _CharT> : _Fill_tm_formatter<_CHRONO year_month, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO year_month_day, _CharT> //
: _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};
struct formatter<_CHRONO year_month_day, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO year_month_day_last, _CharT> //
: _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};
struct formatter<_CHRONO year_month_day_last, _CharT> : _Fill_tm_formatter<_CHRONO year_month_day_last, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO year_month_weekday, _CharT> //
: _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};
struct formatter<_CHRONO year_month_weekday, _CharT> : _Fill_tm_formatter<_CHRONO year_month_weekday, _CharT> {};

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

template <class _CharT>
struct formatter<_CHRONO sys_info, _CharT> //
: _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};
struct formatter<_CHRONO sys_info, _CharT> : _Fill_tm_formatter<_CHRONO sys_info, _CharT> {};

template <class _CharT>
struct formatter<_CHRONO local_info, _CharT> //
: _Fill_tm_formatter<_CHRONO local_info, _CharT> {};
struct formatter<_CHRONO local_info, _CharT> : _Fill_tm_formatter<_CHRONO local_info, _CharT> {};

template <class _Duration, class _CharT>
struct formatter<_CHRONO sys_time<_Duration>, _CharT> {
Expand Down Expand Up @@ -5974,8 +5956,7 @@ private:
};

template <class _Duration, class _CharT>
struct formatter<_CHRONO local_time<_Duration>, _CharT> //
: _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};
struct formatter<_CHRONO local_time<_Duration>, _CharT> : _Fill_tm_formatter<_CHRONO local_time<_Duration>, _CharT> {};

template <class _Duration, class _CharT>
struct formatter<_CHRONO _Local_time_format_t<_Duration>, _CharT>
Expand Down
12 changes: 4 additions & 8 deletions stl/inc/execution
Original file line number Diff line number Diff line change
Expand Up @@ -3883,10 +3883,8 @@ _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs
const auto _ULast2 = _Get_unwrapped(_Last2);
auto _UDest = _Get_unwrapped_unverified(_Dest);
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2, _FwdIt3>;
if constexpr (remove_reference_t<_ExPo>::_Parallelize //
&& _Is_ranges_random_iter_v<_FwdIt1> //
&& _Is_ranges_random_iter_v<_FwdIt2> //
&& _Is_cpp17_random_iter_v<_FwdIt3>) {
if constexpr (remove_reference_t<_ExPo>::_Parallelize && _Is_ranges_random_iter_v<_FwdIt1>
&& _Is_ranges_random_iter_v<_FwdIt2> && _Is_cpp17_random_iter_v<_FwdIt3>) {
// only parallelize if desired, and all of the iterators given are random access
const size_t _Hw_threads = __std_parallel_algorithms_hw_threads();
if (_Hw_threads > 1) { // parallelize on multiprocessor machines
Expand Down Expand Up @@ -3975,10 +3973,8 @@ _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2
const auto _ULast2 = _Get_unwrapped(_Last2);
auto _UDest = _Get_unwrapped_unverified(_Dest);
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2, _FwdIt3>;
if constexpr (remove_reference_t<_ExPo>::_Parallelize //
&& _Is_ranges_random_iter_v<_FwdIt1> //
&& _Is_ranges_random_iter_v<_FwdIt2> //
&& _Is_cpp17_random_iter_v<_FwdIt3>) {
if constexpr (remove_reference_t<_ExPo>::_Parallelize && _Is_ranges_random_iter_v<_FwdIt1>
&& _Is_ranges_random_iter_v<_FwdIt2> && _Is_cpp17_random_iter_v<_FwdIt3>) {
// only parallelize if desired, and all of the iterators given are random access
const size_t _Hw_threads = __std_parallel_algorithms_hw_threads();
if (_Hw_threads > 1) { // parallelize on multiprocessor machines
Expand Down
22 changes: 11 additions & 11 deletions stl/inc/expected
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public:
is_nothrow_copy_constructible_v<_Ty>&& is_nothrow_copy_constructible_v<_Err> //
&& is_nothrow_copy_assignable_v<_Ty>&& is_nothrow_copy_assignable_v<_Err>) // strengthened
requires is_copy_assignable_v<_Ty> && is_copy_constructible_v<_Ty> //
&& is_copy_assignable_v<_Err> && is_copy_constructible_v<_Err> //
&& is_copy_assignable_v<_Err> && is_copy_constructible_v<_Err>
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
{
if (_Has_value && _Other._Has_value) {
Expand All @@ -409,9 +409,9 @@ public:

constexpr expected& operator=(expected&& _Other) noexcept(
is_nothrow_move_constructible_v<_Ty>&& is_nothrow_move_constructible_v<_Err> //
&& is_nothrow_move_assignable_v<_Ty>&& is_nothrow_move_assignable_v<_Err>) //
&& is_nothrow_move_assignable_v<_Ty>&& is_nothrow_move_assignable_v<_Err>)
requires is_move_assignable_v<_Ty> && is_move_constructible_v<_Ty> //
&& is_move_assignable_v<_Err> && is_move_constructible_v<_Err> //
&& is_move_assignable_v<_Err> && is_move_constructible_v<_Err>
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
{
if (_Has_value && _Other._Has_value) {
Expand Down Expand Up @@ -514,9 +514,9 @@ public:

// [expected.object.swap]
constexpr void swap(expected& _Other) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_swappable_v<_Ty>&&
is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>) //
is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>)
requires is_swappable_v<_Ty> && is_swappable_v<_Err> //
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> //
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err>
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
{
using _STD swap;
Expand Down Expand Up @@ -567,9 +567,9 @@ public:
}

friend constexpr void swap(expected& _Lhs, expected& _Rhs) noexcept(is_nothrow_move_constructible_v<_Ty>&&
is_nothrow_swappable_v<_Ty>&& is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>) //
is_nothrow_swappable_v<_Ty>&& is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>)
requires is_swappable_v<_Ty> && is_swappable_v<_Err> //
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> //
&& is_move_constructible_v<_Ty> && is_move_constructible_v<_Err>
&& (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>)
{
_Lhs.swap(_Rhs);
Expand Down Expand Up @@ -1221,14 +1221,14 @@ public:

template <class _UErr>
requires is_constructible_v<_Err, const _UErr&>
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) //
noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
constexpr explicit(!is_convertible_v<const _UErr&, _Err>) expected(const unexpected<_UErr>& _Other) noexcept(
is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened
: _Unexpected(_Other._Unexpected), _Has_value(false) {}

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

constexpr explicit expected(in_place_t) noexcept : _Has_value(true) {}
Expand Down
8 changes: 3 additions & 5 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace ranges {
constexpr bool _Is_sized1 = sized_sentinel_for<_Se, _It>;
constexpr bool _Is_sized2 = sized_sentinel_for<_OSe, _Out>;
if constexpr (_Iter_copy_cat<_It, _Out>::_Bitcopy_constructible
&& _Sized_or_unreachable_sentinel_for<_Se, _It> //
&& _Sized_or_unreachable_sentinel_for<_Se, _It>
&& _Sized_or_unreachable_sentinel_for<_OSe, _Out>) {
if constexpr (_Is_sized1 && _Is_sized2) {
return _Copy_memcpy_common(_IFirst, _RANGES next(_IFirst, _STD move(_ILast)), _OFirst,
Expand Down Expand Up @@ -3348,10 +3348,8 @@ public:

template <class _Uty, class _Is_nullptr = is_same<_Uty, nullptr_t>>
using _Enable_ctor_reset =
enable_if_t<is_same_v<_Uty, pointer> //
|| _Is_nullptr::value //
|| (is_same_v<pointer, element_type*> //
&& is_pointer_v<_Uty> //
enable_if_t<is_same_v<_Uty, pointer> || _Is_nullptr::value
|| (is_same_v<pointer, element_type*> && is_pointer_v<_Uty>
&& is_convertible_v<remove_pointer_t<_Uty> (*)[], element_type (*)[]>),
int>;

Expand Down
Loading