16 Mar
2005
16 Mar
'05
5:48 p.m.
Renaud Lepere wrote:
I was not clear, if we consider the following code
bool f() { shared_ptr<int> p1(new int(0)); shared_ptr<int> p2(new int(0)); return (p1 < p2); }
int main() { // some function calls bool b1(f()); // some other function calls bool b2(f(()); assert(b1 == b2); return 0; }
will the assertion be always true (is f() a deterministic function).
No, the assertion is not guaranteed to be true.