Closed GoogleCodeExporter closed 9 years ago
As a possibility, I moved the three local structs to an anonymous namespace
right before the function and kept the "static" qualifier - I'm hoping what
VS2003 is choking on is instantiating the local struct. Can you check to see if
it works? (r436)
Thanks!
Original comment by jbe...@gmail.com
on 2 Mar 2011 at 5:22
Same error:
c:\coding\yaml-cpp\trunk\src\emitter.cpp(625): fatal error C1001: INTERNAL
COMPILER ERROR (compiler file
'f:\vs70builds\6030\vc\Compiler\Utc\src\P2\main.c', line 148)
Again the static of "const BoolTypes boolTypes".
Original comment by matthias...@gmail.com
on 2 Mar 2011 at 7:58
Hopefully done this time, r441. I refactored it to nested switch statements,
which should be more appetizing to VS, plus made it conform to the standard
with short bool names.
Original comment by jbe...@gmail.com
on 2 Mar 2011 at 9:00
VS2003: library only, all 4 configurations built (parse.cpp has an issue left)
VS2005: all 4 configurations built
Original comment by matthias...@gmail.com
on 2 Mar 2011 at 9:41
Does it make any difference if ComputeFullBoolName() is an object method or a
static/class method (e.g. memory consumption of instances)?
Original comment by matthias...@gmail.com
on 3 Mar 2011 at 7:52
Shouldn't make any difference (it just depends whether you pass the hidden
"this" parameter). I made it an object method because it needs the three
boolean state variables. We could just as easily make it a free function and
add those three parameters to its signature (and I suppose it *might* be
faster, since it could be inlined, but it's not as if we're calling it
frequently, and it's not that tiny of a method). Why?
Original comment by jbe...@gmail.com
on 3 Mar 2011 at 7:58
Just curious. Only asked as boolTypes was static before.
Original comment by matthias...@gmail.com
on 3 Mar 2011 at 8:09
Oh, I see. The reason it was static before *was* a memory/speed thing. We were
building a little data structure with all of the different bool names, and it
was just a small optimization (pretty tiny, to be honest) to have it not build
that every time it called the function, especially since there were strings
involved. (Although the strings were small enough that they probably would be
in stack memory - most string implementations have a 16-char buffer on the
stack before they start dynamically allocating.)
So yeah, it probably didn't make much of a difference, but it was one keyword :)
And in any case, it was an ugly way to do it - I think the switch statements
read better.
Original comment by jbe...@gmail.com
on 3 Mar 2011 at 8:26
Original issue reported on code.google.com by
matthias...@gmail.com
on 10 Jan 2011 at 6:03Attachments: