I’m going to go off on a tangent and ask: Is a quadtree even necessary?
Note: I’m assuming boids are points, or can be approximated as such.
Boids are apparently only interested in their immediate neighbours and so the query area is going to be fixed and pretty small. Drilling through layers of tree nodes to find out which leaves we should be looking at seems silly when we can directly address into a simple grid of linked lists.
This also gives you back fine-grained (non-power-of-two) control over the number of leaf boxes, so you can experiment with the size of the grid boxes and find the sweet-spot where the false-positive cost of large boxes balances the cost of examining lots of little (probably empty) boxes.
Happily, the degenerate case where all boids are clustered in one box is something that they are specifically trying to avoid.
Unhappily, you’ll fall foul of the no-arrays-of-generic-collections annoyance.