Use nullptr for std::shared_ptr and unique_ptr default parameter

pull/119/head
Tatsuhiro Tsujikawa 2013-08-19 23:50:58 +09:00
parent 5ba7150333
commit b6d84c0160
6 changed files with 8 additions and 10 deletions

View File

@ -238,9 +238,8 @@ public:
(cuid_t cuid, const std::shared_ptr<Request>& req, (cuid_t cuid, const std::shared_ptr<Request>& req,
const std::shared_ptr<FileEntry>& fileEntry, const std::shared_ptr<FileEntry>& fileEntry,
RequestGroup* requestGroup, DownloadEngine* e, RequestGroup* requestGroup, DownloadEngine* e,
const std::shared_ptr<SocketCore>& s = std::shared_ptr<SocketCore>(), const std::shared_ptr<SocketCore>& s = nullptr,
const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer = nullptr,
= std::shared_ptr<SocketRecvBuffer>(),
bool incNumConnection = true); bool incNumConnection = true);
virtual ~AbstractCommand(); virtual ~AbstractCommand();

View File

@ -47,7 +47,7 @@ private:
size_t bytesProcessed_; size_t bytesProcessed_;
public: public:
ChunkedDecodingStreamFilter ChunkedDecodingStreamFilter
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{}); (std::unique_ptr<StreamFilter> delegate = nullptr);
virtual ~ChunkedDecodingStreamFilter(); virtual ~ChunkedDecodingStreamFilter();

View File

@ -52,7 +52,7 @@ private:
static const size_t OUTBUF_LENGTH = 16*1024; static const size_t OUTBUF_LENGTH = 16*1024;
public: public:
GZipDecodingStreamFilter GZipDecodingStreamFilter
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{}); (std::unique_ptr<StreamFilter> delegate = nullptr);
virtual ~GZipDecodingStreamFilter(); virtual ~GZipDecodingStreamFilter();

View File

@ -86,7 +86,7 @@ namespace aria2 {
namespace { namespace {
std::unique_ptr<StreamFilter> getTransferEncodingStreamFilter std::unique_ptr<StreamFilter> getTransferEncodingStreamFilter
(HttpResponse* httpResponse, (HttpResponse* httpResponse,
std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{}) std::unique_ptr<StreamFilter> delegate = nullptr)
{ {
if(httpResponse->isTransferEncodingSpecified()) { if(httpResponse->isTransferEncodingSpecified()) {
auto filter = httpResponse->getTransferEncodingStreamFilter(); auto filter = httpResponse->getTransferEncodingStreamFilter();
@ -106,7 +106,7 @@ std::unique_ptr<StreamFilter> getTransferEncodingStreamFilter
namespace { namespace {
std::unique_ptr<StreamFilter> getContentEncodingStreamFilter std::unique_ptr<StreamFilter> getContentEncodingStreamFilter
(HttpResponse* httpResponse, (HttpResponse* httpResponse,
std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{}) std::unique_ptr<StreamFilter> delegate = nullptr)
{ {
if(httpResponse->isContentEncodingSpecified()) { if(httpResponse->isContentEncodingSpecified()) {
auto filter = httpResponse->getContentEncodingStreamFilter(); auto filter = httpResponse->getContentEncodingStreamFilter();

View File

@ -45,7 +45,7 @@ namespace aria2 {
class RequestSlot { class RequestSlot {
public: public:
RequestSlot(size_t index, int32_t begin, int32_t length, size_t blockIndex, RequestSlot(size_t index, int32_t begin, int32_t length, size_t blockIndex,
const std::shared_ptr<Piece>& piece = std::shared_ptr<Piece>()) const std::shared_ptr<Piece>& piece = nullptr)
: dispatchedTime_(global::wallclock()), : dispatchedTime_(global::wallclock()),
index_(index), begin_(begin), length_(length), blockIndex_(blockIndex), index_(index), begin_(begin), length_(length), blockIndex_(blockIndex),
piece_(piece) piece_(piece)

View File

@ -50,8 +50,7 @@ class StreamFilter {
private: private:
std::unique_ptr<StreamFilter> delegate_; std::unique_ptr<StreamFilter> delegate_;
public: public:
StreamFilter StreamFilter(std::unique_ptr<StreamFilter> delegate = nullptr);
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{});
virtual ~StreamFilter(); virtual ~StreamFilter();