]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build errors on CentOS 7 in rev.13712
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 21 Nov 2014 04:33:21 +0000 (20:33 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 21 Nov 2014 04:33:21 +0000 (20:33 -0800)
It turns out the RHEL and CentOS 7 STL definition does not quite match
up to official documentation of what their GCC version supports. In
particular the use of const_iterator on std::list containers.

Use auto instead of an explicit iterator. Allowing the compiler to select
whichever iterator is available and will work.

src/acl/MethodData.cc
src/acl/ProtocolData.cc

index 17086a08bcc1bd680dec612c807c646791ec363a..552315cccbd1d2944460b739452439c261180520 100644 (file)
@@ -29,7 +29,7 @@ ACLMethodData::~ACLMethodData()
 bool
 ACLMethodData::match(HttpRequestMethod toFind)
 {
-    for (std::list<HttpRequestMethod>::const_iterator i = values.begin(); i != values.end(); ++i) {
+    for (auto i = values.begin(); i != values.end(); ++i) {
         if (*i == toFind) {
             // tune the list for LRU ordering
             values.erase(i);
index 6f8080e36a49412c0ca01710b0d4a685967b5d0c..d0d96d362d11798ed0b39b9135ef985cb5c8244e 100644 (file)
@@ -28,7 +28,7 @@ ACLProtocolData::~ACLProtocolData()
 bool
 ACLProtocolData::match(AnyP::ProtocolType toFind)
 {
-    for (std::list<AnyP::ProtocolType>::const_iterator itr = values.begin(); itr != values.end(); ++itr) {
+    for (auto itr = values.begin(); itr != values.end(); ++itr) {
         if (*itr == toFind) {
             // tune the list for LRU ordering
             values.erase(itr);