Skip to content

Commit deb5ce5

Browse files
[pre-commit.ci] pre-commit autoupdate (#124)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-clang-format: v14.0.6 → v15.0.4](pre-commit/mirrors-clang-format@v14.0.6...v15.0.4) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 525867b commit deb5ce5

File tree

25 files changed

+166
-338
lines changed

25 files changed

+166
-338
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
autoupdate_branch: 'devel'
33
repos:
44
- repo: https://github.com/pre-commit/mirrors-clang-format
5-
rev: v14.0.6
5+
rev: v15.0.4
66
hooks:
77
- id: clang-format
88
args: ['--style={BasedOnStyle: Mozilla, SortIncludes: false}']

bindings/python/src/optional.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
template<typename T>
1313
struct pybind11::detail::type_caster<tl::optional<T>>
1414
: public pybind11::detail::optional_caster<tl::optional<T>>
15-
{
16-
};
15+
{};
1716

1817
template<>
1918
struct pybind11::detail::type_caster<tl::nullopt_t>
2019
: public pybind11::detail::void_caster<tl::nullopt_t>
21-
{
22-
};
20+
{};
2321
#endif
2422

2523
#endif // ifndef proxsuite_python_optional_hpp

include/proxsuite/helpers/tl-optional.hpp

Lines changed: 38 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@ namespace tl {
7070
namespace detail {
7171
template<class T>
7272
struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T>
73-
{
74-
};
73+
{};
7574
#ifdef _GLIBCXX_VECTOR
7675
template<class T, class A>
7776
struct is_trivially_copy_constructible<std::vector<T, A>>
7877
: std::is_trivially_copy_constructible<T>
79-
{
80-
};
78+
{};
8179
#endif
8280
}
8381
}
@@ -147,17 +145,14 @@ using conditional_t = typename std::conditional<B, T, F>::type;
147145
// std::conjunction from C++17
148146
template<class...>
149147
struct conjunction : std::true_type
150-
{
151-
};
148+
{};
152149
template<class B>
153150
struct conjunction<B> : B
154-
{
155-
};
151+
{};
156152
template<class B, class... Bs>
157153
struct conjunction<B, Bs...>
158154
: std::conditional<bool(B::value), conjunction<Bs...>, B>::type
159-
{
160-
};
155+
{};
161156

162157
#if defined(_LIBCPP_VERSION) && __cplusplus == 201103L
163158
#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
@@ -169,50 +164,40 @@ struct conjunction<B, Bs...>
169164
#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND
170165
template<class T>
171166
struct is_pointer_to_non_const_member_func : std::false_type
172-
{
173-
};
167+
{};
174168
template<class T, class Ret, class... Args>
175169
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...)> : std::true_type
176-
{
177-
};
170+
{};
178171
template<class T, class Ret, class... Args>
179172
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...)&>
180173
: std::true_type
181-
{
182-
};
174+
{};
183175
template<class T, class Ret, class... Args>
184176
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) &&>
185177
: std::true_type
186-
{
187-
};
178+
{};
188179
template<class T, class Ret, class... Args>
189180
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile>
190181
: std::true_type
191-
{
192-
};
182+
{};
193183
template<class T, class Ret, class... Args>
194184
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile&>
195185
: std::true_type
196-
{
197-
};
186+
{};
198187
template<class T, class Ret, class... Args>
199188
struct is_pointer_to_non_const_member_func<Ret (T::*)(Args...) volatile&&>
200189
: std::true_type
201-
{
202-
};
190+
{};
203191

204192
template<class T>
205193
struct is_const_or_const_ref : std::false_type
206-
{
207-
};
194+
{};
208195
template<class T>
209196
struct is_const_or_const_ref<T const&> : std::true_type
210-
{
211-
};
197+
{};
212198
template<class T>
213199
struct is_const_or_const_ref<T const> : std::true_type
214-
{
215-
};
200+
{};
216201
#endif
217202

218203
// std::invoke from C++17
@@ -269,13 +254,11 @@ using invoke_result_t = typename invoke_result<F, Us...>::type;
269254
// TODO make a version which works with MSVC 2015
270255
template<class T, class U = T>
271256
struct is_swappable : std::true_type
272-
{
273-
};
257+
{};
274258

275259
template<class T, class U = T>
276260
struct is_nothrow_swappable : std::true_type
277-
{
278-
};
261+
{};
279262
#else
280263
// https://stackoverflow.com/questions/26744589/what-is-a-proper-way-to-implement-is-swappable-to-test-for-the-swappable-concept
281264
namespace swap_adl_tests {
@@ -313,19 +296,16 @@ struct is_std_swap_noexcept
313296
: std::integral_constant<bool,
314297
std::is_nothrow_move_constructible<T>::value &&
315298
std::is_nothrow_move_assignable<T>::value>
316-
{
317-
};
299+
{};
318300

319301
template<class T, std::size_t N>
320302
struct is_std_swap_noexcept<T[N]> : is_std_swap_noexcept<T>
321-
{
322-
};
303+
{};
323304

324305
template<class T, class U>
325306
struct is_adl_swap_noexcept
326307
: std::integral_constant<bool, noexcept(can_swap<T, U>(0))>
327-
{
328-
};
308+
{};
329309
} // namespace swap_adl_tests
330310

331311
template<class T, class U = T>
@@ -336,8 +316,7 @@ struct is_swappable
336316
(!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value ||
337317
(std::is_move_assignable<T>::value &&
338318
std::is_move_constructible<T>::value))>
339-
{
340-
};
319+
{};
341320

342321
template<class T, std::size_t N>
343322
struct is_swappable<T[N], T[N]>
@@ -346,8 +325,7 @@ struct is_swappable<T[N], T[N]>
346325
decltype(detail::swap_adl_tests::can_swap<T[N], T[N]>(0))::value &&
347326
(!decltype(detail::swap_adl_tests::uses_std<T[N], T[N]>(0))::value ||
348327
is_swappable<T, T>::value)>
349-
{
350-
};
328+
{};
351329

352330
template<class T, class U = T>
353331
struct is_nothrow_swappable
@@ -358,8 +336,7 @@ struct is_nothrow_swappable
358336
detail::swap_adl_tests::is_std_swap_noexcept<T>::value) ||
359337
(!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value &&
360338
detail::swap_adl_tests::is_adl_swap_noexcept<T, U>::value))>
361-
{
362-
};
339+
{};
363340
#endif
364341
#endif
365342

@@ -375,12 +352,10 @@ using void_t = typename voider<Ts...>::type;
375352
// Trait for checking if a type is a tl::optional
376353
template<class T>
377354
struct is_optional_impl : std::false_type
378-
{
379-
};
355+
{};
380356
template<class T>
381357
struct is_optional_impl<optional<T>> : std::true_type
382-
{
383-
};
358+
{};
384359
template<class T>
385360
using is_optional = is_optional_impl<decay_t<T>>;
386361

@@ -397,8 +372,7 @@ struct returns_void_impl;
397372
template<class F, class... U>
398373
struct returns_void_impl<F, void_t<invoke_result_t<F, U...>>, U...>
399374
: std::is_void<invoke_result_t<F, U...>>
400-
{
401-
};
375+
{};
402376
template<class F, class... U>
403377
using returns_void = returns_void_impl<F, void, U...>;
404378

@@ -561,10 +535,7 @@ struct optional_operations_base : optional_storage_base<T>
561535
TL_OPTIONAL_11_CONSTEXPR const T& get() const& { return this->m_value; }
562536
TL_OPTIONAL_11_CONSTEXPR T&& get() && { return std::move(this->m_value); }
563537
#ifndef TL_OPTIONAL_NO_CONSTRR
564-
constexpr const T&& get() const&&
565-
{
566-
return std::move(this->m_value);
567-
}
538+
constexpr const T&& get() const&& { return std::move(this->m_value); }
568539
#endif
569540
};
570541

@@ -1520,33 +1491,21 @@ class optional
15201491
}
15211492

15221493
/// Returns the stored value
1523-
TL_OPTIONAL_11_CONSTEXPR T& operator*() &
1524-
{
1525-
return this->m_value;
1526-
}
1494+
TL_OPTIONAL_11_CONSTEXPR T& operator*() & { return this->m_value; }
15271495

1528-
constexpr const T& operator*() const&
1529-
{
1530-
return this->m_value;
1531-
}
1496+
constexpr const T& operator*() const& { return this->m_value; }
15321497

15331498
TL_OPTIONAL_11_CONSTEXPR T&& operator*() &&
15341499
{
15351500
return std::move(this->m_value);
15361501
}
15371502

15381503
#ifndef TL_OPTIONAL_NO_CONSTRR
1539-
constexpr const T&& operator*() const&&
1540-
{
1541-
return std::move(this->m_value);
1542-
}
1504+
constexpr const T&& operator*() const&& { return std::move(this->m_value); }
15431505
#endif
15441506

15451507
/// Returns whether or not the optional has a value
1546-
constexpr bool has_value() const noexcept
1547-
{
1548-
return this->m_has_value;
1549-
}
1508+
constexpr bool has_value() const noexcept { return this->m_has_value; }
15501509

15511510
constexpr explicit operator bool() const noexcept
15521511
{
@@ -2432,37 +2391,19 @@ class optional<T&>
24322391
return *this = std::forward<U>(u);
24332392
}
24342393

2435-
void swap(optional& rhs) noexcept
2436-
{
2437-
std::swap(m_value, rhs.m_value);
2438-
}
2394+
void swap(optional& rhs) noexcept { std::swap(m_value, rhs.m_value); }
24392395

24402396
/// Returns a pointer to the stored value
2441-
constexpr const T* operator->() const noexcept
2442-
{
2443-
return m_value;
2444-
}
2397+
constexpr const T* operator->() const noexcept { return m_value; }
24452398

2446-
TL_OPTIONAL_11_CONSTEXPR T* operator->() noexcept
2447-
{
2448-
return m_value;
2449-
}
2399+
TL_OPTIONAL_11_CONSTEXPR T* operator->() noexcept { return m_value; }
24502400

24512401
/// Returns the stored value
2452-
TL_OPTIONAL_11_CONSTEXPR T& operator*() noexcept
2453-
{
2454-
return *m_value;
2455-
}
2402+
TL_OPTIONAL_11_CONSTEXPR T& operator*() noexcept { return *m_value; }
24562403

2457-
constexpr const T& operator*() const noexcept
2458-
{
2459-
return *m_value;
2460-
}
2404+
constexpr const T& operator*() const noexcept { return *m_value; }
24612405

2462-
constexpr bool has_value() const noexcept
2463-
{
2464-
return m_value != nullptr;
2465-
}
2406+
constexpr bool has_value() const noexcept { return m_value != nullptr; }
24662407

24672408
constexpr explicit operator bool() const noexcept
24682409
{
@@ -2505,10 +2446,7 @@ class optional<T&>
25052446
}
25062447

25072448
/// Destroys the stored value if one exists, making the optional empty
2508-
void reset() noexcept
2509-
{
2510-
m_value = nullptr;
2511-
}
2449+
void reset() noexcept { m_value = nullptr; }
25122450

25132451
private:
25142452
T* m_value;

include/proxsuite/linalg/dense/core.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static_assert(sizeof(f32) == 4, "f32 should be 32 bits");
104104
static_assert(sizeof(f64) == 8, "f64 should be 64 bits");
105105

106106
#define LDLT_FN_IMPL3(Fn, Prefix, Suffix) \
107-
VEG_INLINE static auto Fn(Pack a, Pack b, Pack c) noexcept->Pack \
107+
VEG_INLINE static auto Fn(Pack a, Pack b, Pack c) noexcept -> Pack \
108108
{ \
109109
return Pack{ simde_mm##Prefix##_##Fn##_##Suffix( \
110110
a.inner, b.inner, c.inner) }; \
@@ -116,11 +116,12 @@ static_assert(sizeof(f64) == 8, "f64 should be 64 bits");
116116
LDLT_FN_IMPL3(fnmadd, Prefix, Suffix); /* (-a * b + c) */
117117

118118
#define LDLT_LOAD_STORE(Prefix, Suffix) \
119-
VEG_INLINE static auto load_unaligned(ScalarType const* ptr) noexcept->Pack \
119+
VEG_INLINE static auto load_unaligned(ScalarType const* ptr) noexcept \
120+
-> Pack \
120121
{ \
121122
return Pack{ simde_mm##Prefix##_loadu_##Suffix(ptr) }; \
122123
} \
123-
VEG_INLINE static auto broadcast(ScalarType value) noexcept->Pack \
124+
VEG_INLINE static auto broadcast(ScalarType value) noexcept -> Pack \
124125
{ \
125126
return Pack{ simde_mm##Prefix##_set1_##Suffix(value) }; \
126127
} \

include/proxsuite/linalg/veg/internal/dyn_index.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ struct binary_traits<Dyn, Dyn>
216216

217217
template<isize N>
218218
struct binary_traits<Fix<N>, Dyn> : binary_traits<Dyn, Dyn>
219-
{
220-
};
219+
{};
221220

222221
template<>
223222
struct binary_traits<Fix<0>, Dyn> : binary_traits<Dyn, Dyn>

include/proxsuite/linalg/veg/internal/fix_index.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,16 @@ namespace idx {
3535
namespace adl {
3636
template<typename T>
3737
struct IdxBase
38-
{
39-
};
38+
{};
4039
} // namespace adl
4140
} // namespace idx
4241
namespace _meta {
4342
template<typename T>
4443
struct is_fix : false_type
45-
{
46-
};
44+
{};
4745
template<isize N>
4846
struct is_fix<Fix<N>> : true_type
49-
{
50-
};
47+
{};
5148
} // namespace _meta
5249
} // namespace _detail
5350

0 commit comments

Comments
 (0)