Sujet : Re: C23 auto x C++ auto.
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 27. May 2024, 10:11:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v31iol$3v634$1@raubtier-asyl.eternal-september.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
Am 27.05.2024 um 07:53 schrieb Blue-Maned_Hawk:
Bonita Montero wrote:
I don't know what type inference in C is good for since the type names
in C are usually short. If I have short typenames in C++ I don't use
type inference. Type-inference makes sense to make such things shorter
typename map<string, string>::const_iterator it = map.cbegin();
This doesn't happen in C.
Type-inference in C is useful for the same sole reason that type-inference
has any use anywhere else: preventing repetition of a typename.
I never use type inference if I have short typenames in C++ because
this is more readable. And in C you only have short typenames.