From 7e301d7a673a58d68a5b79bc6655988b910e7153 Mon Sep 17 00:00:00 2001 From: Tejas Garrepally Date: Mon, 17 Jun 2024 14:46:10 +0800 Subject: [PATCH] fix: fix clang-format violations --- include/fifo.hpp | 2 +- include/utils.hpp | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/fifo.hpp b/include/fifo.hpp index 2957ddb..5fb13be 100644 --- a/include/fifo.hpp +++ b/include/fifo.hpp @@ -73,7 +73,7 @@ class Fifo { } tail = nullptr; } - + Fifo(const Fifo &) = delete; Fifo &operator=(const Fifo &) = delete; }; \ No newline at end of file diff --git a/include/utils.hpp b/include/utils.hpp index 036704f..7208628 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -1,19 +1,18 @@ #include #include -template +template struct __defer_t { - _Fx __fx; + _Fx __fx; - __defer_t(_Fx &&__arg_fx) noexcept( - ::std::is_nothrow_move_constructible_v<_Fx>) - : __fx(::std::move(__arg_fx)) {} + __defer_t(_Fx &&__arg_fx) noexcept(::std::is_nothrow_move_constructible_v<_Fx>) + : __fx(::std::move(__arg_fx)) {} - ~__defer_t() noexcept(::std::is_nothrow_invocable_v<_Fx>) { __fx(); } + ~__defer_t() noexcept(::std::is_nothrow_invocable_v<_Fx>) { __fx(); } }; -template __defer_t(_Fx __fx) -> __defer_t<::std::decay_t<_Fx>>; +template +__defer_t(_Fx __fx) -> __defer_t<::std::decay_t<_Fx>>; #define __DEFER_TOK_PASTE(X, Y) X##Y -#define defer \ - __defer_t __DEFER_TOK_PASTE(__scoped_defer_obj, __COUNTER__) = [&]() +#define defer __defer_t __DEFER_TOK_PASTE(__scoped_defer_obj, __COUNTER__) = [&]()