Does opSlice work with immutable values?

Ali Çehreli acehreli at yahoo.com
Mon Feb 24 09:24:15 PST 2014


On 02/24/2014 09:11 AM, Joseph Cassman wrote:

 > the const keyword added to a [member] function makes the this pointer
 > const. Can't see exactly why this works but it does.

const means "I will not modify data through this reference". Since there 
is not issue with modification, it can refer to mutable and immutable data.

Ali

P.S. It would be great if you could show the issue on a minimal code 
example. I tried to look at your original code but found it to be too 
long. Sorry... :)



More information about the Digitalmars-d-learn mailing list