Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Sat, 6 Jul 2024 14:13:26 +0200 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 06 Jul 2024 14:13:24 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="45d96773d76e1db3d66c08849d740e1f"; logging-data="4004774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jplDBBBq32bv8UuvMLZ6dPcbUtLri4rU=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:rui6kj7dQvCSsLWxk7r8dEAbljE= In-Reply-To: Content-Language: de-DE Bytes: 1905 Am 06.07.2024 um 13:49 schrieb Thiago Adams: > If you were creating C code today and could use a C23 compiler, would > you use nullptr instead of NULL? > I am asking because I think I will keep using NULL. > I like nullptr semantics but I don't like to introduce new element > (nullptr) inside the code with no guarantee that the code will not mix > both. > In the past we also didn't have a guarantee we are not mixing 0 or NULL. > I think the best scenario for a team guideline would be a style warning > if 0 or nullptr is used and NULL to be defined as nullptr in a C23 > compiler. I don't know what nullptr is good for in C23. In C++ it makes sense to have a nullptr to distinguish overloads that take a pointer and those that take an integral; but in C there ain't overloads.