dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

Overcoming the "Most Vexing Parse" Problem

The "most vexing parse" is a mysterious syntactic specter that the compiler interprets in the least expected manner, biting innocent programmers who think their code means something entirely different. Find out where that vexing parse might occur and how to avoid it.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


he C++ literature uses the phrase "most vexing parse" to denote one of the dark syntactic alleys of C++. It's vexing because programmers usually don't even know it exists; they assume that their code creates an object initialized with a temporary, whereas the compiler interprets that same code as no less than a function declaration. This 10-Minute Solution explains where and why that parse problem happens, and presents two simple techniques to avert it.


You define an object whose initializer is a temporary, but the compiler unexpectedly interprets the code as a function declaration.


Rewrite your code so that it avoids the most vexing parse problem.



 

 



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date