1>------ Rebuild All started: Project: mapblock, Configuration: Debug Win32 ------
1> mapblock.cpp
1>c:\...path...\mapblock.cpp(91): fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'msc1.cpp', line 1420)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
The code in question:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// support function. Gets the point of a given exit. If 'actual' is false, the point will
// be "pushed inside" the bounding box. If 'actual' is true, it will be the point on the actual
// block boundary (before padding)
constauto getPoint = [&](int p, bool actual) -> sf::Vector2f
{
float adj = actual ? c_BoundBoxPadding : 0;
switch(p)
{
case U: return sf::Vector2f( (box.l + box.r) / 2, box.u - adj ); // <- line 91
case D: return sf::Vector2f( (box.l + box.r) / 2, box.d + adj );
case L: return sf::Vector2f( box.l - adj , (box.u + box.d) / 2 );
case R: return sf::Vector2f( box.r + adj , (box.u + box.d) / 2 );
case K: return sf::Vector2f( (box.l + box.r) / 2, (box.u + box.d) / 2 );
default: throw std::logic_error("Error in map generation! invalid 'p' value sent to getPoint");
}
};
Any ideas how this could be "simplified"?
XD
EDIT:
I guess I could try getting rid of the lambda, make it a global function and pass the 'box' to it as an argument.....