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 |
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(?). (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 )
|
|
|
|
|
What does , means?
|
|
|
Re: What does , means?
By: mr_ped on Wed, 02 April 2008 09:56
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
By: Werner on Wed, 02 April 2008 12:39
|
|
|
Re: What does , means?
By: mrjt on Wed, 02 April 2008 14:24
|
|
|
Re: What does , means?
By: mirek on Wed, 02 April 2008 15:11
|
|
|
Re: What does , means?
By: mr_ped on Wed, 02 April 2008 17:30
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
By: mdelfede on Mon, 14 April 2008 23:42
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
By: mr_ped on Thu, 03 April 2008 00:27
|
|
|
Re: What does , means?
|
|
|
Re: What does , means?
|
Goto Forum:
Current Time: Mon Apr 29 08:12:44 CEST 2024
Total time taken to generate the page: 0.03443 seconds
|