4 ms·
That's undefined behavior. References in valid C++ cannot be null.
by evanpw 9y ago
That's undefined behavior. References in valid C++ cannot be null.
- lowbloodsugar 9y agoI can write a method that is valid C++, but it gets called by something that isn't valid C++. If I don't check for null references, then my method will crash. My method is valid C++, and yet it gets a null reference. So clearly, references in valid C++ can be null, and must be checked for.