Skip to content

Commit 65827f3

Browse files
author
Igor Egorov
authored
Remove noexcept from p2p (#260)
Signed-off-by: Igor Egorov <[email protected]>
1 parent d997b02 commit 65827f3

52 files changed

Lines changed: 90 additions & 96 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/libp2p/basic/scheduler.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace libp2p::basic {
4040
* Defers callback to be executed during the next IO loop cycle
4141
* @param cb callback
4242
*/
43-
void schedule(Callback &&cb) noexcept {
43+
void schedule(Callback &&cb) {
4444
std::ignore = scheduleImpl(std::move(cb), Time::zero(), false);
4545
}
4646

@@ -49,8 +49,7 @@ namespace libp2p::basic {
4949
* @param cb callback
5050
* @param delay_from_now time interval
5151
*/
52-
void schedule(Callback &&cb,
53-
std::chrono::milliseconds delay_from_now) noexcept {
52+
void schedule(Callback &&cb, std::chrono::milliseconds delay_from_now) {
5453
std::ignore = scheduleImpl(std::move(cb), delay_from_now, false);
5554
}
5655

@@ -60,7 +59,7 @@ namespace libp2p::basic {
6059
* @return handle which can be used for cancelling, rescheduling, and scoped
6160
* lifetime
6261
*/
63-
[[nodiscard]] Handle scheduleWithHandle(Callback &&cb) noexcept {
62+
[[nodiscard]] Handle scheduleWithHandle(Callback &&cb) {
6463
return scheduleImpl(std::move(cb), Time::zero(), true);
6564
}
6665

@@ -72,15 +71,15 @@ namespace libp2p::basic {
7271
* lifetime
7372
*/
7473
[[nodiscard]] Handle scheduleWithHandle(
75-
Callback &&cb, std::chrono::milliseconds delay_from_now) noexcept {
74+
Callback &&cb, std::chrono::milliseconds delay_from_now) {
7675
return scheduleImpl(std::move(cb), delay_from_now, true);
7776
}
7877

7978
/**
8079
* Backend's async
8180
* @return milliseconds since async's epoch
8281
*/
83-
virtual std::chrono::milliseconds now() const noexcept = 0;
82+
virtual std::chrono::milliseconds now() const = 0;
8483

8584
/**
8685
* Doesn't allow lvalue callbacks
@@ -99,6 +98,6 @@ namespace libp2p::basic {
9998
*/
10099
virtual Handle scheduleImpl(Callback &&cb,
101100
std::chrono::milliseconds delay_from_now,
102-
bool make_handle) noexcept = 0;
101+
bool make_handle) = 0;
103102
};
104103
} // namespace libp2p::basic

include/libp2p/basic/scheduler/asio_scheduler_backend.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace libp2p::basic {
3232
/**
3333
* @return Milliseconds since steady clock's epoch
3434
*/
35-
std::chrono::milliseconds now() const noexcept override;
35+
std::chrono::milliseconds now() const override;
3636

3737
/**
3838
* Sets the timer. Called by Scheduler implementation

include/libp2p/basic/scheduler/backend.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace libp2p::basic {
2121
/**
2222
* Called from backend to fire callbacks
2323
*/
24-
virtual void pulse() noexcept = 0;
24+
virtual void pulse() = 0;
2525
};
2626

2727
/**
@@ -44,7 +44,7 @@ namespace libp2p::basic {
4444
* Current async
4545
* @return Milliseconds elapsed from async's epoch
4646
*/
47-
virtual std::chrono::milliseconds now() const noexcept = 0;
47+
virtual std::chrono::milliseconds now() const = 0;
4848

4949
/**
5050
* Implementation-defined defer or delay function.

include/libp2p/basic/scheduler/manual_scheduler_backend.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace libp2p::basic {
2828
/**
2929
* @return Milliseconds since clock's epoch. Clock is set manually
3030
*/
31-
std::chrono::milliseconds now() const noexcept override {
31+
std::chrono::milliseconds now() const override {
3232
return current_clock_;
3333
}
3434

include/libp2p/basic/scheduler/scheduler_impl.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ namespace libp2p::basic {
2828
Scheduler::Config config);
2929

3030
/// Returns current async
31-
std::chrono::milliseconds now() const noexcept override;
31+
std::chrono::milliseconds now() const override;
3232

3333
/// Scheduler API impl
3434
Handle scheduleImpl(Callback &&cb,
3535
std::chrono::milliseconds delay_from_now,
36-
bool make_handle) noexcept override;
36+
bool make_handle) override;
3737

3838
/// Timer callback, called from SchedulerBackend
39-
void pulse() noexcept override;
39+
void pulse() override;
4040

4141
private:
4242
size_t callReady(Time now);

include/libp2p/connection/layer_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace libp2p::connection {
3030

3131
/// returns if this side is an initiator of this connection, or false if it
3232
/// was a server in that case
33-
virtual bool isInitiator() const noexcept = 0;
33+
virtual bool isInitiator() const = 0;
3434

3535
/**
3636
* @brief Get local multiaddress for this connection.

include/libp2p/event/bus.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace libp2p::event {
6464
* Explicitly unsubscribe from channel before the lifetime
6565
* of this object expires
6666
*/
67-
void unsubscribe() noexcept {
67+
void unsubscribe() {
6868
if (handle_.connected()) {
6969
try {
7070
handle_.disconnect();
@@ -78,7 +78,7 @@ namespace libp2p::event {
7878
Handle() = default;
7979

8080
/// Cancels existing connection
81-
Handle &operator=(Handle &&rhs) noexcept {
81+
Handle &operator=(Handle &&rhs) {
8282
unsubscribe();
8383
handle_ = std::move(rhs.handle_);
8484

include/libp2p/layer/websocket/ssl_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace libp2p::connection {
2525
std::shared_ptr<LayerConnection> connection,
2626
std::shared_ptr<boost::asio::ssl::context> ssl_context);
2727

28-
bool isInitiator() const noexcept override;
28+
bool isInitiator() const override;
2929
outcome::result<multi::Multiaddress> localMultiaddr() override;
3030
outcome::result<multi::Multiaddress> remoteMultiaddr() override;
3131

include/libp2p/layer/websocket/ws_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace libp2p::connection {
5555
std::shared_ptr<LayerConnection> connection,
5656
std::shared_ptr<basic::Scheduler> scheduler);
5757

58-
bool isInitiator() const noexcept override;
58+
bool isInitiator() const override;
5959

6060
void start();
6161
void stop();

include/libp2p/multi/multihash.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace libp2p::multi {
2323
public:
2424
Multihash(const Multihash &other) = default;
2525
Multihash &operator=(const Multihash &other) = default;
26-
Multihash(Multihash &&other) noexcept = default;
27-
Multihash &operator=(Multihash &&other) noexcept = default;
26+
Multihash(Multihash &&other) = default;
27+
Multihash &operator=(Multihash &&other) = default;
2828
~Multihash() = default;
2929

3030
using Buffer = Bytes;

0 commit comments

Comments
 (0)