Pass std::unique_ptr by value

pull/103/head
Tatsuhiro Tsujikawa 2013-06-23 16:24:47 +09:00
parent 23086b6e21
commit 28c84148e4
5 changed files with 5 additions and 5 deletions

View File

@ -150,7 +150,7 @@ void DownloadContext::setFileFilter(SegList<int>& sgl)
}
void DownloadContext::setAttribute
(ContextAttributeType key, std::unique_ptr<ContextAttribute>&& value)
(ContextAttributeType key, std::unique_ptr<ContextAttribute> value)
{
assert(key < MAX_CTX_ATTR);
attrs_[key] = std::move(value);

View File

@ -204,7 +204,7 @@ public:
}
void setAttribute
(ContextAttributeType key, std::unique_ptr<ContextAttribute>&& value);
(ContextAttributeType key, std::unique_ptr<ContextAttribute> value);
ContextAttribute* getAttribute(ContextAttributeType key);

View File

@ -394,7 +394,7 @@ ParameterOptionHandler::ParameterOptionHandler
(const Pref* pref,
const char* description,
const std::string& defaultValue,
std::vector<std::string>&& validParamValues,
std::vector<std::string> validParamValues,
char shortName)
: AbstractOptionHandler(pref, description, defaultValue,
OptionHandler::REQ_ARG, shortName),

View File

@ -181,7 +181,7 @@ public:
ParameterOptionHandler(const Pref* pref,
const char* description,
const std::string& defaultValue,
std::vector<std::string>&& validParamValues,
std::vector<std::string> validParamValues,
char shortName = 0);
virtual ~ParameterOptionHandler();
virtual void parseArg(Option& option, const std::string& optarg) const;

View File

@ -55,7 +55,7 @@ public:
return instance_.get();
}
static void instance(std::unique_ptr<T>&& ptr)
static void instance(std::unique_ptr<T> ptr)
{
instance_ = std::move(ptr);
}