Re: std.algorithm.map - function by reference

2014-06-24 Thread Justin Whear via Digitalmars-d-learn
On Tue, 24 Jun 2014 21:46:15 +, kuba wrote: Hi there, I was wondering if std.algorithm.map can take functions with parameters passed by reference? The main point here is to avoid unnecessary copies by perhaps I'm using the wrong tool for the job. No, `map` is a _projection_ function

Re: std.algorithm.map - function by reference

2014-06-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 24 June 2014 at 21:46:16 UTC, kuba wrote: The main point here is to avoid unnecessary copies You should make sure this actually matters - passing doubles by ref for example is probably slower than just passing a regular double.