Microsoft Visual Studio Professional 2015版本14.0.25431.01更新3 编译code below时不会发出错误。我错过了什么吗?
谢谢。
#include <iostream>
template < class T > constexpr T oops( T s )
{
std::cout << s; // ignored - no code is generated
return s;
}
int main()
{
static_assert( oops( 1 ) == 1, "!" ); // non-constant condition not detected
return 0;
}