From: Amos Jeffries Date: Sun, 25 Jan 2015 04:53:40 +0000 (-0800) Subject: Older Clang versions do not seem to offer full C++11 std::splice API X-Git-Tag: merge-candidate-3-v1~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=524f5ff607c606f9dadee6d6194d0e77df5eb4d1;p=thirdparty%2Fsquid.git Older Clang versions do not seem to offer full C++11 std::splice API --- diff --git a/src/acl/CertificateData.cc b/src/acl/CertificateData.cc index 050bdafa12..f85fe64c97 100644 --- a/src/acl/CertificateData.cc +++ b/src/acl/CertificateData.cc @@ -78,7 +78,13 @@ ACLCertificateData::dump() const if (validAttributesStr) sl.push_back(SBuf(attribute)); +#if __cplusplus >= 201103L sl.splice(sl.end(),values.dump()); +#else + // temp is needed until c++11 move constructor + SBufList tmp = values.dump(); + sl.splice(sl.end(),tmp); +#endif return sl; } diff --git a/src/acl/HttpHeaderData.cc b/src/acl/HttpHeaderData.cc index 5e57a8d781..9617078b84 100644 --- a/src/acl/HttpHeaderData.cc +++ b/src/acl/HttpHeaderData.cc @@ -60,9 +60,13 @@ ACLHTTPHeaderData::dump() const { SBufList sl; sl.push_back(SBuf(hdrName)); +#if __cplusplus >= 201103L + sl.splice(sl.end(), regex_rule->dump()); +#else // temp is needed until c++11 move-constructor SBufList temp = regex_rule->dump(); sl.splice(sl.end(), temp); +#endif return sl; } diff --git a/src/acl/NoteData.cc b/src/acl/NoteData.cc index 135ac16cf8..c54e6e0440 100644 --- a/src/acl/NoteData.cc +++ b/src/acl/NoteData.cc @@ -64,9 +64,13 @@ ACLNoteData::dump() const { SBufList sl; sl.push_back(SBuf(name)); +#if __cplusplus >= 201103L + sl.splice(sl.end(), values->dump()); +#else // temp is needed until c++11 move constructor SBufList temp = values->dump(); sl.splice(sl.end(), temp); +#endif return sl; } diff --git a/src/acl/Tree.cc b/src/acl/Tree.cc index 3aaf6f560b..5aff46fb12 100644 --- a/src/acl/Tree.cc +++ b/src/acl/Tree.cc @@ -73,9 +73,13 @@ Acl::Tree::treeDump(const char *prefix, const ActionToString &convert) const ++action; } +#if __cplusplus >= 201103L + sl.splice(text.end(), (*node)->dump()); +#else // temp is needed until c++11 move constructor SBufList temp = (*node)->dump(); text.splice(text.end(), temp); +#endif text.push_back(SBuf("\n")); } return text;