Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-16 12:48:23


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net