c++: references cannot be NULL