For a hashtable to know about its container is probably more wasteful than having a pointer to the allocator. If you don't like deep nesting, write a shortcut function, which will do the entire job for you similar to the read function: http://dlang.org/phobos/std_file.html#.read