struct C {
f() const {
?()
}
g() Xg {
h()
}
h() Xh {
}
};
compiles without errors when ? is g but has compile-time errors when
? is h. What are Xg and Xh?
Explain.
void delete_value_1(vector& ivec, int v) { const vector ::iterator e = ivec.end(); vector ::iterator s = ivec.begin(); while ((s = find(s, e, v)) != e) ivec.erase(s); } void delete_value_2(vector & ivec, int v) { const vector ::iterator e = ivec.end(); vector ::iterator s = remove(ivec.begin(), e, v); ivec.erase(s, e); }
Do an analysis that determines which of the versions, if any, is asymptotically better than the other.
This page last modified on 16 November 2002.