On Friday, 19 June 2015 at 14:19:49 UTC, Ivan Timokhin wrote:
On Fri, Jun 19, 2015 at 01:49:14PM +0000, Jonathan M Davis wrote:
On Friday, 19 June 2015 at 13:36:22 UTC, Andrei Alexandrescu wrote:
>> 3. Shouldn't `front` functions be const?
>
> Good point. Made const.

That's not necessarily a good idea. What if the element type can't even be used when it's const? inout might work in that case, but in general, you have to be _very_ careful with slapping const on generic code.

- Jonathan M Davis

The return type was const from the beginning; see also http://forum.dlang.org/post/mlvuh3$2du2$1...@digitalmars.com

Well, it won't work in the general case to have front returning a const value. There are too many types that are completely unusable when const. It may be that you don't want it returning by ref if it's not const, but const is simply way too restrictive to be required.

- Jonathan M Davis

Reply via email to