Sujet : question about nullptr
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 06. Jul 2024, 12:49:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6bavg$3pu5i$1@dont-email.me>
User-Agent : Mozilla Thunderbird
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.