C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Possible deprecation of -> operator

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Mon, 10 Feb 2025 11:06:11 +0100
A buggy program in general can be valid. A UB program is not valid. A pointer can be nullptr, as long as it is never dereferenced. A reference cannot refer to an object with an address of nullptr. Such a program is not a valid C++ program. -----Ursprüngliche Nachricht----- Von:Tiago Freire <tmiguelf_at_[hidden]> Gesendet:Mo 10.02.2025 10:44 Betreff:RE: [std-proposals] Possible deprecation of -> operator An:std-proposals_at_[hidden]; CC:Sebastian Wittmeier <wittmeier_at_[hidden]>; > It is not possible to write a valid C++ program, where the address of a reference is the nullptr. Never heard of that. I guess that depends on your definition of valid, if writing bugs is not a “valid” C++ program, but there’s nothing stopping you from writing them. And it has never stopped me from catching exactly this bug many times. I’ve even given you an example on how to do exactly this on my previous email.

Received on 2025-02-10 10:10:13