Is there any real reason to use "const"?
timon.gehr at gmx.ch
Tue Jan 25 07:55:04 UTC 2022
On 24.01.22 18:47, Ali Çehreli wrote:
> However, const on the function API is also for communication: It tells
> the caller what parameters are not going to be mutated by the function.
> But I've become one of the people who advocate 'in' over 'const'
> especially when compiled with -preview=in:
> Sweet! 'in' even enables passing rvalues by reference! :)
Actually I am very disappointed that passing rvalues by ref is now tied
to transitive const. Makes no sense.
More information about the Digitalmars-d