Skip to content

Commit 5e187e7

Browse files
committed
use c++11 std::unique_ptr instead of boost::shared_ptr
1 parent 947913f commit 5e187e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/rpc/server.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <boost/thread.hpp>
2626
#include <boost/algorithm/string/case_conv.hpp> // for to_upper()
2727

28+
#include <memory> // for unique_ptr
29+
2830
using namespace RPCServer;
2931
using namespace std;
3032

@@ -34,9 +36,8 @@ static std::string rpcWarmupStatus("RPC server started");
3436
static CCriticalSection cs_rpcWarmup;
3537
/* Timer-creating functions */
3638
static RPCTimerInterface* timerInterface = NULL;
37-
/* Map of name to timer.
38-
* @note Can be changed to std::unique_ptr when C++11 */
39-
static std::map<std::string, boost::shared_ptr<RPCTimerBase> > deadlineTimers;
39+
/* Map of name to timer. */
40+
static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers;
4041

4142
static struct CRPCSignals
4243
{
@@ -490,7 +491,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
490491
throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
491492
deadlineTimers.erase(name);
492493
LogPrint("rpc", "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
493-
deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
494+
deadlineTimers.insert(std::make_pair(name, std::unique_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
494495
}
495496

496497
CRPCTable tableRPC;

0 commit comments

Comments
 (0)