Explorar el Código

Pass std::unique_ptr by value

Tatsuhiro Tsujikawa hace 12 años
padre
commit
28c84148e4

+ 1 - 1
src/DownloadContext.cc

@@ -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);

+ 1 - 1
src/DownloadContext.h

@@ -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);
 

+ 1 - 1
src/OptionHandlerImpl.cc

@@ -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),

+ 1 - 1
src/OptionHandlerImpl.h

@@ -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;

+ 1 - 1
src/SingletonHolder.h

@@ -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);
   }