B
borsanyi
Dear All,
coming from C, I understand that the order of evaluation of
subexpressions is unspecified, unless there
is a sequence point somewhere in between. Suppose A,B,C,D are
instances of a class X with an overloaded
operator+ and operator*, that create and return temporary objects of
the same type.
1) Is the compiler allowed to optimize using threads when compiling
the following statement?
X result=A*B+C*D;
Or from the developer's point of view, does the operator* have to
be reentrant?
(I am tempted to use static objects instead of creating temporary
ones,
you can tell me if that's a bad design.)
2) Is the time of calling the destructors specified? My system
destroys the temporary objects after
the construction of 'result'.
thanks, Szabolcs
coming from C, I understand that the order of evaluation of
subexpressions is unspecified, unless there
is a sequence point somewhere in between. Suppose A,B,C,D are
instances of a class X with an overloaded
operator+ and operator*, that create and return temporary objects of
the same type.
1) Is the compiler allowed to optimize using threads when compiling
the following statement?
X result=A*B+C*D;
Or from the developer's point of view, does the operator* have to
be reentrant?
(I am tempted to use static objects instead of creating temporary
ones,
you can tell me if that's a bad design.)
2) Is the time of calling the destructors specified? My system
destroys the temporary objects after
the construction of 'result'.
thanks, Szabolcs