M

Most vexing parse

Syntactic ambiguity in C++

The most vexing parse is a counterintuitive ambiguity resolution in C++. In certain situations, the C++ grammar cannot distinguish between initializing an object parameter, declaring an object or declaring a function while specifying the function's return type.

Nº Q6916825 ★

Commune · Histoire

Most vexing parse

Syntactic ambiguity in C++

Texte en anglais

The most vexing parse is a counterintuitive ambiguity resolution in C++. In certain situations, the C++ grammar cannot distinguish between initializing an object parameter, declaring an object or declaring a function while specifying the function's return type.

Dernier prix

—

Prix plancher

—

Médiane 7 j

—

Ventes 30 j

0

Fourchette 30 j

—

En circulation

0

Cours

Voir le tableau
Datemédiane MinMaxventes

Historique des ventes

Dernière vente
—
Moyenne 30 j
—
Plus bas 30 j
—
Plus haut 30 j
—
Ventes 7 j
0
Ventes 30 j
0

Aucune vente pour l'instant.

Ventes anonymes : ni acheteur ni vendeur. Les chiffres ne comptent que les ventes entre joueurs.

Sur Wikipédia

Texte en anglais Pas encore d'article dans ta langue : extrait en anglais.

The most vexing parse is a counterintuitive ambiguity resolution in C++. In certain situations, the C++ grammar cannot distinguish between initializing an object parameter, declaring an object or declaring a function while specifying the function's return type. In these situations, the compiler is required to interpret the statement as the latter, even though this is rarely the programmer's intention. The problem originates from backward compatibility constraints imposed by the need for C++ to be a superset of C. C has no concept of object creation, and thus will always parse the code as a function declaration. C++ introduced syntax for object creation that inadvertently coincides with function type declaration in some cases. The term was first used by Scott Meyers in his 2001 book Effective STL. It was a common problem for C++ versions prior to C++11, which introduced an alternative syntax called uniform initialization that uses braces {} instead of parentheses (), avoiding the syntactic ambiguity.

Texte : Wikipédia en anglais, CC BY-SA 4.0. ·

Cartes voisines

Voir la fiche

Confirmation