Re: returning lvalue in C vs C++
- From: Phlip <phlip2005@xxxxxxxxx>
- Date: Wed, 29 Mar 2006 22:44:38 GMT
Ben C wrote:
f().x = 200; /* "invalid lvalue" in C, but not in C++ apparently */
Consider the general scheme of C++, and specifically its overloaded
operators.
x.operator=() (figuratively) could have a side-effect that your code depends
on. So regardless where 'thing' appears, thing.x is accessible as an
lvalue.
--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
.
- Follow-Ups:
- Re: returning lvalue in C vs C++
- From: Ben C
- Re: returning lvalue in C vs C++
- References:
- returning lvalue in C vs C++
- From: Ben C
- returning lvalue in C vs C++
- Prev by Date: returning lvalue in C vs C++
- Next by Date: Re: returning lvalue in C vs C++
- Previous by thread: returning lvalue in C vs C++
- Next by thread: Re: returning lvalue in C vs C++
- Index(es):