Skip to content

Commit

Permalink
fix: fix clang-format violations
Browse files Browse the repository at this point in the history
  • Loading branch information
g-tejas committed Jun 17, 2024
1 parent 65fc44c commit 7e301d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/fifo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Fifo {
}
tail = nullptr;
}

Fifo(const Fifo &) = delete;
Fifo &operator=(const Fifo &) = delete;
};
17 changes: 8 additions & 9 deletions include/utils.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#include <type_traits>
#include <utility>

template<typename _Fx>
template <typename _Fx>
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<typename _Fx> __defer_t(_Fx __fx) -> __defer_t<::std::decay_t<_Fx>>;
template <typename _Fx>
__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__) = [&]()

0 comments on commit 7e301d7

Please sign in to comment.