]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed build on systems needing explicit <utility> in RegexPattern.cc.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 14 Aug 2016 01:17:57 +0000 (19:17 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sun, 14 Aug 2016 01:17:57 +0000 (19:17 -0600)
... after r14795.

Also removed bogus comments implying that std::move() does something to
its argument. That function is just a type cast; it does nothing else!
We use std::move() so that the compiler picks a move constructor or
assignment (where available). In case of RegexPattern::flags, using
std::move() has no effect because integers do not have those move
methods. However, it may be a good idea to use std::move() anyway
because the type of RegexPattern::flags might change in the future and
for consistency sake. Thus, I did not remove std::move(), only comments.

src/base/RegexPattern.cc

index 4ab829aa8a5352a5df7466b7e7a82a25b8b7a74a..b6923326d4cb4b7328114b54dbd3f5ec76e5a5e1 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "squid.h"
 #include "base/RegexPattern.h"
+#include <utility>
 
 RegexPattern::RegexPattern(int aFlags, const char *aPattern) :
     flags(aFlags),
@@ -17,7 +18,7 @@ RegexPattern::RegexPattern(int aFlags, const char *aPattern) :
 }
 
 RegexPattern::RegexPattern(RegexPattern &&o) :
-    flags(std::move(o.flags)), // does o.flags=0
+    flags(std::move(o.flags)),
     regex(std::move(o.regex)),
     pattern(std::move(o.pattern))
 {
@@ -34,7 +35,7 @@ RegexPattern::~RegexPattern()
 RegexPattern &
 RegexPattern::operator =(RegexPattern &&o)
 {
-    flags = std::move(o.flags); // does o.flags=0
+    flags = std::move(o.flags);
     regex = std::move(o.regex);
     memset(&o.regex, 0, sizeof(o.regex));
     pattern = std::move(o.pattern);