Fun with templates

Marco Leise Marco.Leise at gmx.de
Sun Jul 7 04:43:46 PDT 2013


Am Sun, 07 Jul 2013 01:04:52 +0400
schrieb Dmitry Olshansky <dmitry.olsh at gmail.com>:

> I've seen an aggressive proposal back in the day to just do a shallow 
> unqual on all aggregates passed by value.

I came to the same conclusion. If feasible, type inference
should always produce tail-const versions.
Well, Rebinable!T then for classes. ;)
It is really annoying to have value types like ints passed in
as immutable/const, just because they were at the call site.
Even for array slices arguments it's sometimes neat to be able
to shrink the passed slice to remove elements that you don't
need to process (whitespace, zeroes, ...)

-- 
Marco



More information about the Digitalmars-d mailing list