Skip to content

Commit 21ca7a5

Browse files
committed
formatting
1 parent 25da392 commit 21ca7a5

File tree

5 files changed

+45
-34
lines changed

5 files changed

+45
-34
lines changed

include/utl/iterator_facade.h

+38-25
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ class iterator_facade : detail::iterator_facade_base {
260260
*/
261261
[[nodiscard]] constexpr friend auto operator-(const self_type& left,
262262
const self_type& right) noexcept
263-
requires detail::iter_is_random_access<self_type> {
263+
requires detail::iter_is_random_access<self_type>
264+
{
264265
return right.distance_to(left);
265266
}
266267

@@ -297,8 +298,9 @@ class iterator_facade : detail::iterator_facade_base {
297298
}
298299
}
299300

300-
constexpr self_type& operator--() noexcept requires
301-
detail::iter_is_bidirectional<self_type> {
301+
constexpr self_type& operator--() noexcept
302+
requires detail::iter_is_bidirectional<self_type>
303+
{
302304
if constexpr (detail::iter_has_decrement_method<self_type>) {
303305
_self().decrement();
304306
} else {
@@ -307,31 +309,35 @@ class iterator_facade : detail::iterator_facade_base {
307309
return _self();
308310
}
309311

310-
constexpr self_type operator--(
311-
int) noexcept requires detail::iter_is_bidirectional<self_type> {
312+
constexpr self_type operator--(int) noexcept
313+
requires detail::iter_is_bidirectional<self_type>
314+
{
312315
auto cp = _self();
313316
--*this;
314317
return cp;
315318
}
316319

317320
template <detail::iter_diff<self_type> Diff>
318-
[[nodiscard]] constexpr friend self_type operator+(
319-
self_type left,
320-
Diff off) noexcept requires detail::iter_is_random_access<self_type> {
321+
[[nodiscard]] constexpr friend self_type operator+(self_type left,
322+
Diff off) noexcept
323+
requires detail::iter_is_random_access<self_type>
324+
{
321325
return left += off;
322326
}
323327

324328
template <detail::iter_diff<self_type> D>
325329
[[nodiscard]] constexpr friend self_type operator+(
326-
D off, const self_type& self) noexcept requires
327-
detail::iter_is_random_access<self_type> {
330+
D off, const self_type& self) noexcept
331+
requires detail::iter_is_random_access<self_type>
332+
{
328333
return self + off;
329334
}
330335

331336
template <detail::iter_diff<self_type> D>
332-
[[nodiscard]] constexpr friend self_type operator-(
333-
const self_type& self,
334-
D off) noexcept requires detail::iter_is_random_access<self_type> {
337+
[[nodiscard]] constexpr friend self_type operator-(const self_type& self,
338+
D off) noexcept
339+
requires detail::iter_is_random_access<self_type>
340+
{
335341
using diff_type = detail::infer_difference_type_t<self_type>;
336342
using signed_diff_type = std::make_signed_t<diff_type>;
337343
return self + -static_cast<signed_diff_type>(off);
@@ -345,20 +351,23 @@ class iterator_facade : detail::iterator_facade_base {
345351

346352
template <detail::iter_diff<self_type> D>
347353
constexpr friend self_type& operator+=(self_type& self, D off) noexcept
348-
requires detail::iter_is_random_access<self_type> {
354+
requires detail::iter_is_random_access<self_type>
355+
{
349356
self.advance(off);
350357
return self;
351358
}
352359

353360
template <detail::iter_diff<self_type> D>
354361
constexpr friend self_type& operator-=(self_type& self, D off) noexcept
355-
requires detail::iter_is_random_access<self_type> {
362+
requires detail::iter_is_random_access<self_type>
363+
{
356364
return self = self - off;
357365
}
358366

359367
template <detail::iter_diff<self_type> D>
360-
[[nodiscard]] constexpr decltype(auto) operator[](
361-
D pos) const noexcept requires detail::iter_is_random_access<self_type> {
368+
[[nodiscard]] constexpr decltype(auto) operator[](D pos) const noexcept
369+
requires detail::iter_is_random_access<self_type>
370+
{
362371
return *(_self() + pos);
363372
}
364373

@@ -422,13 +431,15 @@ class iterator_facade : detail::iterator_facade_base {
422431
*/
423432
[[nodiscard]] friend constexpr bool operator<(const self_type& left,
424433
const self_type& right) noexcept
425-
requires detail::iter_is_random_access<self_type> {
434+
requires detail::iter_is_random_access<self_type>
435+
{
426436
return (left - right) < 0;
427437
}
428438

429439
[[nodiscard]] friend constexpr bool operator<=(
430-
const self_type& left, const self_type& right) noexcept requires
431-
detail::iter_is_random_access<self_type> {
440+
const self_type& left, const self_type& right) noexcept
441+
requires detail::iter_is_random_access<self_type>
442+
{
432443
return (left - right) <= 0;
433444
}
434445

@@ -437,13 +448,15 @@ class iterator_facade : detail::iterator_facade_base {
437448
*/
438449
[[nodiscard]] friend constexpr bool operator>(const self_type& left,
439450
const self_type& right) noexcept
440-
requires detail::iter_is_random_access<self_type> {
451+
requires detail::iter_is_random_access<self_type>
452+
{
441453
return (left - right) > 0;
442454
}
443455

444456
[[nodiscard]] friend constexpr bool operator>=(
445-
const self_type& left, const self_type& right) noexcept requires
446-
detail::iter_is_random_access<self_type> {
457+
const self_type& left, const self_type& right) noexcept
458+
requires detail::iter_is_random_access<self_type>
459+
{
447460
return (left - right) >= 0;
448461
}
449462
}; // namespace utl
@@ -484,8 +497,8 @@ class iterator_wrapper_facade : public iterator_facade<Derived> {
484497
namespace std {
485498

486499
template <typename Derived>
487-
requires std::is_base_of_v<utl::detail::iterator_facade_base,
488-
Derived> //
500+
requires std::is_base_of_v<utl::detail::iterator_facade_base,
501+
Derived> //
489502
struct iterator_traits<Derived> {
490503
static const Derived& _const_it;
491504
using reference = decltype(*_const_it);

include/utl/parser/arg_parser.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,15 @@ inline bool parse_arg(cstr& s, bool& b, bool const default_value = false) {
113113
std::tolower(s[1]) == 'r' && //
114114
std::tolower(s[2]) == 'u' && //
115115
std::tolower(s[3]) == 'e';
116-
for (int i = 0; i < 4 && s; ++i, ++s)
117-
;
116+
for (int i = 0; i < 4 && s; ++i, ++s);
118117
return ret;
119118
} else if (c == 'f') {
120119
auto const ret = s.len == 5 && //
121120
std::tolower(s[1]) == 'a' && //
122121
std::tolower(s[2]) == 'l' && //
123122
std::tolower(s[3]) == 's' && //
124123
std::tolower(s[4]) == 'e';
125-
for (int i = 0; i < 5 && s; ++i, ++s)
126-
;
124+
for (int i = 0; i < 5 && s; ++i, ++s);
127125
return ret;
128126
}
129127
return false;

include/utl/parser/cstr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <cassert>
44
#include <cctype>
5-
#include <cstring>
65
#include <cstdint>
6+
#include <cstring>
77

88
#include <algorithm>
99
#include <limits>

include/utl/pipes/iota.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ struct iota_range {
4444
};
4545

4646
template <typename FromIntType, typename ToIntType>
47-
iota_range(FromIntType, ToIntType)
48-
-> iota_range<clear_t<FromIntType>, clear_t<ToIntType>>;
47+
iota_range(FromIntType,
48+
ToIntType) -> iota_range<clear_t<FromIntType>, clear_t<ToIntType>>;
4949

5050
template <typename FromIntType, typename ToIntType>
5151
auto iota(FromIntType&& from, ToIntType&& to) {

include/utl/to_set.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace utl {
88

99
template <typename It, typename UnaryOperation>
10-
inline auto to_set(It b, It e, UnaryOperation&& op)
11-
-> std::set<decltype(op(*b))> {
10+
inline auto to_set(It b, It e,
11+
UnaryOperation&& op) -> std::set<decltype(op(*b))> {
1212
using set = std::set<decltype(op(*b))>;
1313
set s(std::distance(s, e));
1414
std::transform(b, e, std::insert_iterator<set>(s), op);

0 commit comments

Comments
 (0)