mutable reference > pointer

2012-06-06 Thread Gor Gyolchanyan
I had this idea for a long time now and was trying to find a reason why it was a bad idea. I failed to find that reason, so here it is: The idea is to have a mutable reference: int& a; // This is a mutable reference (essentially a pointer, but with reversed behavior). assert(&a is null); // the a

Re: mutable reference > pointer

2012-06-06 Thread Dmitry Olshansky
On 06.06.2012 15:45, Gor Gyolchanyan wrote: I had this idea for a long time now and was trying to find a reason why it was a bad idea. I failed to find that reason, so here it is: There is. For one thing I like pointer for being explicit about dereferencing something. In this sense having ref

Re: mutable reference > pointer

2012-06-06 Thread Gor Gyolchanyan
On Wed, Jun 6, 2012 at 3:58 PM, Dmitry Olshansky wrote: > On 06.06.2012 15:45, Gor Gyolchanyan wrote: >> >> I had this idea for a long time now and was trying to find a reason >> why it was a bad idea. >> I failed to find that reason, so here it is: >> > > There is. For one thing I like pointer fo

Re: mutable reference > pointer

2012-06-06 Thread Paulo Pinto
On Wednesday, 6 June 2012 at 11:58:12 UTC, Dmitry Olshansky wrote: On 06.06.2012 15:45, Gor Gyolchanyan wrote: I had this idea for a long time now and was trying to find a reason why it was a bad idea. I failed to find that reason, so here it is: There is. For one thing I like pointer for be

Re: mutable reference > pointer

2012-06-06 Thread Nathan M. Swan
On Wednesday, 6 June 2012 at 11:45:34 UTC, Gor Gyolchanyan wrote: I had this idea for a long time now and was trying to find a reason why it was a bad idea. I failed to find that reason, so here it is: The idea is to have a mutable reference: int& a; // This is a mutable reference (essentially