Use C++03...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2010-10-20 16:00:45 +00:00
parent a9cf7b8443
commit 9f608b1919

View File

@ -68,7 +68,12 @@ Path::operator=(StringRef that) {
struct ScopedNullTerminator {
std::string &str;
ScopedNullTerminator(std::string &s) : str(s) { str.push_back(0); }
~ScopedNullTerminator() { str.pop_back(); }
~ScopedNullTerminator() {
// str.pop_back(); But wait, C++03 doesn't have this...
assert(!str.empty() && str[str.size() - 1] == 0
&& "Null char not present!");
str.resize(str.size() - 1);
}
};
bool