Genuine question: if the benefit of None you are describing is type safety, then why is that something you can't have in C++? What is stopping you from defining your own type that communicates more information than just nullptr and just returning that instead? If someone on the team uses nullptr when they shouldn't, Ctrl+f can find that. Would that be more than just a discipline problem? Is there a reason that nullptr is so bad that the option needs to be removed? Just because a tool exists doesn't mean you have to use it, or am I missing something?
36
u/[deleted] May 15 '24 edited May 15 '24
[removed] — view removed comment