Re: Taking a constant reference to a constant/non const object

2017-11-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/15/17 6:46 AM, Jonathan M Davis wrote: On Wednesday, November 15, 2017 09:49:56 helxi via Digitalmars-d-learn wrote: On Wednesday, 15 November 2017 at 09:34:32 UTC, helxi wrote: On Wednesday, 15 November 2017 at 09:23:53 UTC, Jonathan M Davis wrote: On Wednesday, November 15, 2017 09:04

Re: Taking a constant reference to a constant/non const object

2017-11-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 15, 2017 09:49:56 helxi via Digitalmars-d-learn wrote: > On Wednesday, 15 November 2017 at 09:34:32 UTC, helxi wrote: > > On Wednesday, 15 November 2017 at 09:23:53 UTC, Jonathan M > > > > Davis wrote: > >> On Wednesday, November 15, 2017 09:04:50 helxi via > >> > >> Digital

Re: Taking a constant reference to a constant/non const object

2017-11-15 Thread helxi via Digitalmars-d-learn
On Wednesday, 15 November 2017 at 09:34:32 UTC, helxi wrote: On Wednesday, 15 November 2017 at 09:23:53 UTC, Jonathan M Davis wrote: On Wednesday, November 15, 2017 09:04:50 helxi via Digitalmars-d-learn wrote: Hi. What function signature should I use for receiving a constant reference of an r/

Re: Taking a constant reference to a constant/non const object

2017-11-15 Thread helxi via Digitalmars-d-learn
On Wednesday, 15 November 2017 at 09:23:53 UTC, Jonathan M Davis wrote: On Wednesday, November 15, 2017 09:04:50 helxi via Digitalmars-d-learn wrote: Hi. What function signature should I use for receiving a constant reference of an r/l value object? Is it auto fn(inout ref const myClass obj)? I

Re: Taking a constant reference to a constant/non const object

2017-11-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 15, 2017 09:04:50 helxi via Digitalmars-d-learn wrote: > Hi. What function signature should I use for receiving a constant > reference of an r/l value object? Is it auto fn(inout ref const > myClass obj)? > I want to: > 1. Take a constant reference of the object, not copy th

Taking a constant reference to a constant/non const object

2017-11-15 Thread helxi via Digitalmars-d-learn
Hi. What function signature should I use for receiving a constant reference of an r/l value object? Is it auto fn(inout ref const myClass obj)? I want to: 1. Take a constant reference of the object, not copy them 2. The object itself may be const or non const.