C++ Compilers & IDEs for Windows

Started by
40 comments, last by L. Spiro 12 years, 1 month ago
[quote name='SuperVGA' timestamp='1331730897' post='4921952'] [quote name='YogurtEmperor' timestamp='1331729197' post='4921945'] template> // Operator >> can’t be used here. template > // Oh I see that wasn’t the >> operator, my bad. Sorry my support for templates is a little off.
Well, it is good coding practice to have space between '<'s, '>'s and their contained identifiers when you don't stream or bit shift. - I'm not sure the C++ standard mentions anything about the spacing, -and then would a compiler developer know what is the "right way"? The compiler should always be able to determine the enclosing tags by counting them, naturally, if they are separate characters. But if the operands have << overloaded, like std::string, it will likely assume that rather than bit shift or templates afaik. [/quote] As mentioned, it was code generated by Flex or Bison, which is a cross-platform generator that is widely used on all platforms, so for it to generate code that cannot compile on the next most major compiler after Microsoft® Visual Studio® is a little suspect.[/quote]
Sure, but Is it the compilation or the generation which is suspicious?

Whether or not the blame for >> falls on the standard rather than on GCC: #1: Perfectly valid template code caused an internal error in GCC 4.2. I don’t remember the exact error phrase but at the time I checked Google and found it to be a known bug introduced in version 4.0. #2: So switching over to Apple LLVM. A template had a static variable which was initialized in a different translation unit (from the translation unit of a class that inherited from that template).
...
Compiler error or linker error. Pick your poison.

I'm not saying that your generated code isn't valid, only that it's unclear to developers of both code-generating compilers and binaries what is actually valid, more so what is correct. So I'm not picking anything; only saying that if no party has a good definition on what is correct, and/or how the other parts will respond to or generate certain syntax, it does get difficult.
And if for instance the standard has no clear definition saying "> >"closes a two nested template types, >> doesn't", it's just difficult to reasonably point your finger to either party.

But I do understand your frustration with templates and tedious refactoring.
There's only a few things more annoying than doing something right, and then have your trusted compiler tell you that it ain't.
Advertisement
The generating of cross-platform code that does not work on the most widely used cross-platform compiler is suspect.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement