Questions tagged «icc»

3
为什么使用英特尔C ++编译器的NaN-NaN == 0.0?
众所周知,NaN是以算术方式传播的,但是我找不到任何演示,因此我写了一个小测试: #include <limits> #include <cstdio> int main(int argc, char* argv[]) { float qNaN = std::numeric_limits<float>::quiet_NaN(); float neg = -qNaN; float sub1 = 6.0f - qNaN; float sub2 = qNaN - 6.0f; float sub3 = qNaN - qNaN; float add1 = 6.0f + qNaN; float add2 = qNaN + qNaN; float …
300 c++  c  floating-point  ieee-754  icc 

2
weak_ptr重置会影响shared_ptr吗?
我不习惯使用它weak_ptr,我正面临一个令人困惑的情况。我正在将Intel XE 2019 Composer更新5(程序包2019.5.281)与Visual Studio 2019版本结合使用。16.2.5。我用64位编译。我使用标准的C ++ 17。 这是我的秒杀解决方案的代码: #include <memory> #include <iostream> using namespace std; int main( int argc, char* argv[] ) { shared_ptr<int> sp = make_shared<int>( 42 ); cout << "*sp = " << *sp << endl; weak_ptr<int> wp = sp; cout << "*sp = " << *sp …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.