The lambda elements should be taken by const reference here, and we can move the virtual directory passed to ReplaceFileWithSubdirectory()