Re: Frustrations with const

2012-03-09 Thread Timon Gehr
On 03/08/2012 09:06 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 02:50:50PM -0500, Steven Schveighoffer wrote: On Thu, 08 Mar 2012 14:49:12 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: [...] inout(Slot)* findSlot(Key key)

Re: Frustrations with const

2012-03-09 Thread H. S. Teoh
On Fri, Mar 09, 2012 at 11:24:46AM +0100, Timon Gehr wrote: On 03/08/2012 09:06 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 02:50:50PM -0500, Steven Schveighoffer wrote: [...] What is type slot, and how is it constructed? This snippit isn't enough to provide help. [...] Slot is a

Re: Frustrations with const

2012-03-09 Thread Adam D. Ruppe
On Friday, 9 March 2012 at 15:30:50 UTC, H. S. Teoh wrote: Yeah, that would be very useful. I think it was actually decided to do that... they made the change for templates already. PS: you might want to take a look at your mutt settings. Your replies seem to have a truncated References

[OT] mutt settings (Was: Re: Frustrations with const)

2012-03-09 Thread H. S. Teoh
On Fri, Mar 09, 2012 at 04:39:13PM +0100, Adam D. Ruppe wrote: [...] PS: you might want to take a look at your mutt settings. Your replies seem to have a truncated References header which messes up threading in many clients. Oh really? I don't think I changed any settings related to that.

Frustrations with const

2012-03-08 Thread H. S. Teoh
I'm writing an AA implementation, and ran into this problem with the way const behaves in D. Basically, I have an auxiliary function that searches the internal hash table for a given key, and returns the slot containing the matching entry, if found. The problem is, how to write this function so

Re: Frustrations with const

2012-03-08 Thread Timon Gehr
On 03/08/2012 08:09 PM, H. S. Teoh wrote: I'm writing an AA implementation, and ran into this problem with the way const behaves in D. Basically, I have an auxiliary function that searches the internal hash table for a given key, and returns the slot containing the matching entry, if found. The

Re: Frustrations with const

2012-03-08 Thread H. S. Teoh
On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: On 03/08/2012 08:09 PM, H. S. Teoh wrote: [...] The problem is, how to write this function so that it can be called from *both* a const public method and a non-const public method? Since the method itself doesn't actually modify

Re: Frustrations with const

2012-03-08 Thread Steven Schveighoffer
On Thu, 08 Mar 2012 14:49:12 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: On 03/08/2012 08:09 PM, H. S. Teoh wrote: [...] The problem is, how to write this function so that it can be called from *both* a const public method

Re: Frustrations with const

2012-03-08 Thread H. S. Teoh
On Thu, Mar 08, 2012 at 02:50:50PM -0500, Steven Schveighoffer wrote: On Thu, 08 Mar 2012 14:49:12 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: [...] inout(Slot)* findSlot(Key key) inout { ... } Ahhh. Thanks! But that still

Re: Frustrations with const

2012-03-08 Thread Timon Gehr
On 03/08/2012 08:49 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: On 03/08/2012 08:09 PM, H. S. Teoh wrote: [...] The problem is, how to write this function so that it can be called from *both* a const public method and a non-const public method? Since the

Re: Frustrations with const

2012-03-08 Thread Steven Schveighoffer
On Thu, 08 Mar 2012 15:06:19 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 08, 2012 at 02:50:50PM -0500, Steven Schveighoffer wrote: On Thu, 08 Mar 2012 14:49:12 -0500, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 08, 2012 at 08:22:05PM +0100, Timon Gehr wrote: [...]