Skip to content

Commit 160cad2

Browse files
committed
Lots of minor formatting ammendmends
1 parent 21643ed commit 160cad2

32 files changed

Lines changed: 131 additions & 127 deletions

File tree

libraries/core/src/morpheus/core/base/assert.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace morpheus
2121
#define MORPHEUS_ASSERT_ENABLED
2222
#endif
2323

24-
2524
#if defined(MORPHEUS_ASSERT_ENABLED)
2625
#define MORPHEUS_ASSERT_HANDLER(type, expr, msg) MORPHEUS_VERIFY_HANDLER(type, expr, msg)
2726
#else

libraries/core/src/morpheus/core/base/assert_handler.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,4 @@ enum class MORPHEUSCORE_EXPORT AssertType
6060
MORPHEUSCORE_EXPORT void assertHandler(AssertType type, sl_ns::source_location const location, std::string_view const expr,
6161
std::string_view message = std::string_view());
6262

63-
64-
6563
} // namespace morpheus

libraries/core/src/morpheus/core/base/exceptions.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#pragma once
33

44
#include <morpheus/core/base/cold.hpp>
5-
#include <morpheus/core/conformance/format.hpp> // IWYU pragma: export
5+
#include <morpheus/core/conformance/format.hpp> // IWYU pragma: export
66
#include <morpheus/core/conformance/stacktrace.hpp> // IWYU pragma: export
77

88
#include <boost/exception/detail/error_info_impl.hpp>
@@ -28,14 +28,12 @@ using ExceptionInfo = boost::error_info<struct tag_stacktrace, st_ns::stacktrace
2828
/// Format string specifying message output.
2929
/// \param[in] args
3030
/// Arguments to be fed into the formatted message output
31-
template<class... Args>
31+
template <class... Args>
3232
[[noreturn]] MORPHEUS_FUNCTION_COLD void throwRuntimeException(fmt_ns::format_string<Args...> fmt, Args&&... args)
3333
{
3434
// Defect report https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2905r2.html resolves make_format_args to only accept l-values.
3535
throwRuntimeException(fmt_ns::vformat(fmt.get(), fmt_ns::make_format_args(args...)));
3636
}
3737
/// @}
3838

39-
40-
4139
} // namespace morpheus

libraries/core/src/morpheus/core/base/verify.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#include <morpheus/core/base/assert_handler.hpp>
44

55
#define MORPHEUS_VERIFY_HANDLER(type, expr, msg) \
6-
do { \
6+
do \
7+
{ \
78
if ((!static_cast<bool>(expr))) [[unlikely]] \
89
assertHandler(type, MORPHEUS_CURRENT_LOCATION, #expr, msg); \
910
} \
@@ -13,7 +14,7 @@
1314
/// Helper macro to verify an expression succeeds.
1415
/// \param[in] expr
1516
/// Expression to verify
16-
#define MORPHEUS_VERIFY(expr) MORPHEUS_VERIFY_HANDLER(AssertType::Verify, expr, {})
17+
#define MORPHEUS_VERIFY(expr) MORPHEUS_VERIFY_HANDLER(AssertType::Verify, expr, {})
1718

1819
/// \def MORPHEUS_VERIFY_MSG
1920
/// Helper macro to verify an expression succeeds and print a message on failure.

libraries/core/src/morpheus/core/concurrency/generator.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ struct Generator
2222
{
2323

2424
struct promise_type;
25-
using handle_type = coro_ns::coroutine_handle<promise_type>; ///< Handle to generator coroutines.
26-
using value_type = T; ///< Value type from resulting generation.
25+
using handle_type = coro_ns::coroutine_handle<promise_type>; ///< Handle to generator coroutines.
26+
using value_type = T; ///< Value type from resulting generation.
2727
using reference = std::conditional_t<std::is_reference_v<T>, T, const value_type&>; ///< Reference type to the value type.
28-
using pointer = std::add_pointer_t<reference>; ///< Pointer type to the value type.
28+
using pointer = std::add_pointer_t<reference>; ///< Pointer type to the value type.
2929

3030
Generator(handle_type h) : coro(h) {}
3131

@@ -57,7 +57,7 @@ struct Generator
5757

5858
auto return_void() { return coro_ns::suspend_never{}; }
5959

60-
template<std::convertible_to<T> From>
60+
template <std::convertible_to<T> From>
6161
auto yield_value(From&& from)
6262
{
6363
current_value = std::forward<From>(from);
@@ -75,8 +75,8 @@ struct Generator
7575
{
7676
public:
7777
using value_type = Generator::value_type; ///< Value type pointed to by the iterator.
78-
using reference = Generator::reference; ///< Reference to the underlying value type pointed to by the iterator.
79-
using pointer = Generator::pointer; ///< Pointer to the underlying value type pointed to by the iterator.
78+
using reference = Generator::reference; ///< Reference to the underlying value type pointed to by the iterator.
79+
using pointer = Generator::pointer; ///< Pointer to the underlying value type pointed to by the iterator.
8080
using difference_type = std::ptrdiff_t;
8181
using iterator_category = std::input_iterator_tag;
8282

libraries/core/src/morpheus/core/containers/concepts/allocator_aware.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace morpheus::containers::concepts
1313
/// <a href="https://eel.is/c++draft/container.alloc.reqmts">[container.alloc.reqmts]</a>, details at
1414
/// <a href="https://en.cppreference.com/w/cpp/named_req/AllocatorAwareContainer">AllocatorAwareContainer</a>.
1515
template <typename X>
16-
concept AllocatorAware = Container<X> && requires(X x, X&& rx, typename X::allocator_type a){
16+
concept AllocatorAware = Container<X> && requires(X x, X&& rx, typename X::allocator_type a) {
1717
requires std::same_as<typename X::allocator_type::value_type, typename X::value_type>;
1818
requires std::default_initializable<X>;
1919
{ X(a) };

libraries/core/src/morpheus/core/containers/concepts/contiguous.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace morpheus::containers::concepts
1313
/// <a href="https://eel.is/c++draft/container.requirements.general">[container.requirements.general]</a>, details at
1414
/// <a href="https://en.cppreference.com/w/cpp/named_req/ContiguousContainer">ContiguousContainer</a>.
1515
template <typename T>
16-
concept Contiguous = StrictSequence<T> && requires(T t){
16+
concept Contiguous = StrictSequence<T> && requires(T t) {
1717
requires std::contiguous_iterator<typename T::iterator>;
1818
requires std::contiguous_iterator<typename T::const_iterator>;
1919
};

libraries/core/src/morpheus/core/containers/unordered_dense.hpp

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,49 @@ namespace morpheus::containers
1212
/// \struct string_hash
1313
/// Defines a hasher for string which enable heterogeneous overloads as outlined at
1414
/// <a href="https://github.com/martinus/unordered_dense?tab=readme-ov-file#324-heterogeneous-overloads-using-is_transparent ">unordered_dense</a>
15-
struct string_hash {
15+
struct string_hash
16+
{
1617
using is_transparent = void; ///< Enable heterogeneous overloads
1718
using is_avalanching = void; ///< Mark class as high quality avalanching hash
1819

19-
[[nodiscard]] auto operator()(std::string_view str) const noexcept -> std::uint64_t {
20-
return ankerl::unordered_dense::hash<std::string_view>{}(str);
21-
}
20+
[[nodiscard]] auto operator()(std::string_view str) const noexcept -> std::uint64_t { return ankerl::unordered_dense::hash<std::string_view>{}(str); }
2221
};
2322

2423
namespace details
2524
{
2625

27-
template<typename K, typename V>
28-
struct UnorderdDenseMap {
26+
template <typename K, typename V>
27+
struct UnorderdDenseMap
28+
{
2929
using type = ankerl::unordered_dense::map<K, V>;
3030
};
3131

32-
template<typename V>
33-
struct UnorderdDenseMap<std::string, V> {
32+
template <typename V>
33+
struct UnorderdDenseMap<std::string, V>
34+
{
3435
using type = ankerl::unordered_dense::map<std::string, V, string_hash, std::equal_to<>>;
3536
};
3637

37-
template<typename V>
38-
struct UnorderdDenseSet {
38+
template <typename V>
39+
struct UnorderdDenseSet
40+
{
3941
using type = ankerl::unordered_dense::set<V>;
4042
};
4143

42-
template<>
43-
struct UnorderdDenseSet<std::string> {
44+
template <>
45+
struct UnorderdDenseSet<std::string>
46+
{
4447
using type = ankerl::unordered_dense::set<std::string, string_hash, std::equal_to<>>;
4548
};
4649

47-
}
50+
} // namespace details
4851

4952
/// Helper alias which ensure users get heterogeneous overloads where possible.
50-
template<typename K, typename V>
53+
template <typename K, typename V>
5154
using UnorderedMap = typename details::UnorderdDenseMap<K, V>::type;
5255

5356
/// Helper alias which ensure users get heterogeneous overloads where possible.
54-
template<typename V>
55-
using UnorderedSet = typename details::UnorderdDenseSet< V>::type;
57+
template <typename V>
58+
using UnorderedSet = typename details::UnorderdDenseSet<V>::type;
5659

57-
}
60+
} // namespace morpheus::containers

libraries/core/src/morpheus/core/conversion/string.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ namespace morpheus::conversion
1313
/// A class template the represents a customisation point to specialise to provide conversion between a type and
1414
/// its string representation.
1515
/// \tparam T The type to convert to and from a string.
16-
template<typename T>
16+
template <typename T>
1717
struct StringConverter
1818
{
1919
/// A deleted constructor indicates a disabled string converter
2020
StringConverter() = delete;
2121
};
2222

23-
template<typename T>
23+
template <typename T>
2424
concept StringConvertionEnabled = std::is_constructible_v<StringConverter<T>>;
2525

2626
/// Convert a value of type T to its string representation.

libraries/core/src/morpheus/core/memory/concepts/copier.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ namespace morpheus::memory::concepts
1111
template <typename T, typename C>
1212
concept Copier = requires(T t, C c) {
1313
typename T::deleter_type;
14-
{
15-
t(c)
16-
} -> std::same_as<C*>;
14+
{ t(c) } -> std::same_as<C*>;
1715
};
1816

1917
/// \struct default_copy

0 commit comments

Comments
 (0)