G
Goran Pusic
Hi all!
I understand the rationale behind the warning 4239 (I think )
(warning C4239: nonstandard extension used : 'argument' : conversion from X
to Y A reference that is not to 'const' cannot be bound to a non-lvalue;
assigment operator takes a reference to non-const)
However, in this situation:
void F(X& x)
I get it for code like this:
F(X());
And I find it perfectly fine. So I have to use pragma's or split this in two
lines like this:
{ X x;
F(x); }
(With brackets, x gest destroyed immediately after the call; without, it
goes out of scope later, which sometimes isn't good; but OK, this is not my
man point)
Anyhow... Yuck!
Anybody has a comment on this isue? (Especially this: what "const" has to do
with anything here!?)
Goran.
I understand the rationale behind the warning 4239 (I think )
(warning C4239: nonstandard extension used : 'argument' : conversion from X
to Y A reference that is not to 'const' cannot be bound to a non-lvalue;
assigment operator takes a reference to non-const)
However, in this situation:
void F(X& x)
I get it for code like this:
F(X());
And I find it perfectly fine. So I have to use pragma's or split this in two
lines like this:
{ X x;
F(x); }
(With brackets, x gest destroyed immediately after the call; without, it
goes out of scope later, which sometimes isn't good; but OK, this is not my
man point)
Anyhow... Yuck!
Anybody has a comment on this isue? (Especially this: what "const" has to do
with anything here!?)
Goran.