On 05/24/2014 11:01 AM, Ali Çehreli wrote:
On 05/24/2014 10:02 AM, w0rp wrote:

 > I have been writing my own hashmap which can provide forward ranges
 > usable in @safe pure nothrow functions, because it's going to be useful
 > for creating graph data structures with the same. I came to writing my
 > ranges and I figured out how to do everything right for just mutable
 > hashmaps, but I have no idea how to manage the tail-const nature of
 > ranges in a variety of combinations. I figured out that I need to
 > satisfy the following constraints.
 >
 > Create a mutable KeyRange over a map which forwards on the right
 > constness for the key type, so the following must be true.
 >
 > HashMap!(K, V).keys.front -> K
 > const(HashMap!(K, V)).keys.front -> const(K)
 > immutable(HashMap!(K, V)).keys.front -> immutable(K)
 >
 > I have encounted some difficulty in trying to write a range which does
 > this.

How timely! :) Jonathan Crapuchettes talked about facing the same issue
in his talk at DConf. Perhaps he will post his WrapMutability template
here or you can wait for his talk on YouTube.

Ali


That presentation is published. WrapMutability appears at 32:55:

  http://www.ustream.tv/recorded/47930242

Ali

Reply via email to