@@ -242,9 +242,9 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
242242 /**
243243 * Returns: a range of the keys in this map.
244244 */
245- auto byKey (this This)() inout @trusted
245+ auto byKey (this This)() inout @safe return scope
246246 {
247- return MapRange! (This, IterType.key)(cast (Unqual! (This)* ) &this );
247+ return MapRange! (This, IterType.key)((() @trusted => cast (Unqual! (This)* ) &this )() );
248248 }
249249
250250 /**
@@ -271,9 +271,9 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
271271 /**
272272 * Returns: a range of the values in this map.
273273 */
274- auto byValue (this This)() inout @trusted
274+ auto byValue (this This)() inout @safe return scope
275275 {
276- return MapRange! (This, IterType.value)(cast (Unqual! (This)* ) &this );
276+ return MapRange! (This, IterType.value)((() @trusted => cast (Unqual! (This)* ) &this )() );
277277 }
278278
279279 // / ditto
@@ -303,9 +303,9 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
303303 * Returns: a range of the kev/value pairs in this map. The element type of
304304 * this range is a struct with `key` and `value` fields.
305305 */
306- auto byKeyValue (this This)() inout @trusted
306+ auto byKeyValue (this This)() inout @safe return scope
307307 {
308- return MapRange! (This, IterType.both)(cast (Unqual! (This)* ) &this );
308+ return MapRange! (This, IterType.both)((() @trusted => cast (Unqual! (This)* ) &this )() );
309309 }
310310
311311 /**
@@ -431,7 +431,7 @@ private:
431431
432432 private :
433433
434- this (Unqual! (MapType)* hm)
434+ this (Unqual! (MapType)* hm) @safe
435435 {
436436 this .hm = hm;
437437 this .bucketIndex = 0 ;
0 commit comments