Use a reference instead of a pointer.

This makes using a std::unique_ptr in the caller more convenient.