Why isn't ++x an lvalue in D?

Bill Baxter wbaxter at gmail.com
Thu Jan 8 18:12:49 PST 2009


Another thread just reminded me of something I use frequently in C++
that doesn't work in D because ++x is not an lvalue:

   int x,N;
  ...
   ++x %= N;

So is there some deep reason for not making it an lvalue like in C++?

--bb



More information about the Digitalmars-d mailing list