i suggest to pass reference instead of a pointer because passing nullptr is not allowed.