The following code compiles with G++ 4.6.1, but not with Visual Studio 2008
return (m_something == 0) ?
throw std::logic_error(\"Something wrong happene
The internal crash can be considered a bug of Visual Studio. A compiler should never crash because of the code being compiled.
This is a very strange usage of the ternary operator, a simple if before the return would be a much preferable idiom:
if(m_something == 0)
throw std::logic_error("Something wrong happened");
return m_something;