I got a bunch of repositories I've created or updated recently and never posted here. Here's one with a few useful classes for space partitioning. The Grid class is the one I use the most and is starting to look good. There's also a KdTree class and the start of a HashTable class. The templates should be straightforward to use and useful for a lot of things. There's also a few examples of use.