Skip to content

Commit 3f55ee2

Browse files
committed
fix compiler in C++ 11
1 parent 6a77f46 commit 3f55ee2

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

include/brynet/base/Timer.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ class RepeatTimer
8181
public:
8282
using Ptr = std::shared_ptr<RepeatTimer>;
8383

84+
RepeatTimer()
85+
{
86+
mCancel.store(false);
87+
}
88+
8489
void cancel()
8590
{
8691
mCancel.store(true);
@@ -92,7 +97,7 @@ class RepeatTimer
9297
}
9398

9499
private:
95-
std::atomic_bool mCancel = {false};
100+
std::atomic_bool mCancel;
96101
};
97102

98103
class TimerMgr final : public std::enable_shared_from_this<TimerMgr>

include/brynet/net/wrapper/ConnectionBuilder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ template<typename Derived>
108108
class BaseConnectionBuilder
109109
{
110110
public:
111-
Derived& WithService(TcpService::Ptr service)
111+
Derived& WithService(ITcpService::Ptr service)
112112
{
113113
mTcpService = std::move(service);
114114
return static_cast<Derived&>(*this);
@@ -198,7 +198,7 @@ class BaseConnectionBuilder
198198
}
199199

200200
private:
201-
TcpService::Ptr mTcpService;
201+
ITcpService::Ptr mTcpService;
202202
ConnectionOption mOption;
203203
SocketConnectBuilder mConnectBuilder;
204204
};

0 commit comments

Comments
 (0)