Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » What does , means?
Re: What does , means? [message #15149 is a reply to message #15130] Thu, 03 April 2008 00:27 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
The problem is with your original post.
That line in general C/C++ can mean pretty much anything.
Well, it's not that bad in C, there's only that preprocessor thing, but it's total havoc in C++ where you can also overload comma operator.

Unless you have full C++ source, ideally preprocessed already (-E switch for GCC), it's impossible to tell what exactly some line does and how it will end after compilation.
It can be eventually preceded by end-of-line comment which ends with backslash by accident, which will make it part of that comment! I have seen it all(?). Very Happy (feeling old)

UPP does use overloaded operators aggressively (like <<= for callbacks and generally to assign value) to get "nicer and cleaner" source, but it makes the source somewhat confusing to pure C++ programmer who didn't study UPP basics. (but any C++ source can be confusing even without UPP magic, just check that link to IOCCC if you don't have idea how bad it can be)

So while the simple guess it's just ordinary comma with useless code (common copy/paste bug, luckily harmless this time) was right, it could have been worser, if someone would deliberately tried to obfuscate it with overloaded comma function and some macros for example with name "angle". Than the correct answer would require to see the definitions of those other things.

There's no other special UPP context about this, it was common *sigh* C++ code.

(anyway, it was very good question, keep asking whenever you don't fully understand some piece of UPP code... you will either learn something new, or help Mirek to find new bug Smile )
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Optimized memcmp for x86
Next Topic: THISBACK and function-overloading
Goto Forum:
  


Current Time: Mon Apr 29 08:12:44 CEST 2024

Total time taken to generate the page: 0.03443 seconds