Skip to content

Commit

Permalink
code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Mar 11, 2024
1 parent af5bac4 commit 67a75f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asyncpp/semaphore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class counting_semaphore {
};

public:
counting_semaphore(ptrdiff_t current_counter = 0, ptrdiff_t max_counter = std::numeric_limits<ptrdiff_t>::max()) noexcept;
explicit counting_semaphore(ptrdiff_t current_counter = 0, ptrdiff_t max_counter = std::numeric_limits<ptrdiff_t>::max()) noexcept;

bool try_acquire() noexcept;
awaitable operator co_await() noexcept;
Expand All @@ -55,7 +55,7 @@ class counting_semaphore {

class binary_semaphore : public counting_semaphore {
public:
binary_semaphore(bool is_free = false) : counting_semaphore(ptrdiff_t(is_free), 1) {}
explicit binary_semaphore(bool is_free = false) : counting_semaphore(static_cast<ptrdiff_t>(is_free), 1) {}
};


Expand Down

0 comments on commit 67a75f3

Please sign in to comment.