Search this blog:
RSS
-
Top Posts & Pages
Categories
Archives
- March 2020 (1)
- November 2017 (2)
- October 2017 (1)
- July 2017 (1)
- November 2016 (1)
- August 2016 (1)
- July 2016 (1)
- March 2016 (2)
- August 2015 (1)
- April 2015 (2)
- March 2015 (1)
- October 2014 (1)
- September 2014 (1)
- August 2014 (1)
- July 2014 (2)
- June 2014 (7)
- February 2014 (3)
- October 2013 (2)
- September 2013 (1)
- August 2013 (2)
- June 2013 (4)
- April 2013 (1)
- March 2013 (2)
- January 2013 (2)
- December 2012 (1)
- September 2012 (2)
- August 2012 (1)
- May 2012 (2)
- April 2012 (6)
- March 2012 (3)
- February 2012 (2)
- December 2011 (2)
- November 2011 (3)
- October 2011 (2)
- September 2011 (1)
- August 2011 (3)
- June 2011 (1)
- May 2011 (3)
- April 2011 (1)
- February 2011 (1)
- January 2011 (2)
- December 2010 (2)
- November 2010 (4)
- September 2010 (1)
- August 2010 (1)
- June 2010 (3)
- May 2010 (2)
- January 2010 (1)
- December 2009 (1)
- November 2009 (3)
- October 2009 (3)
- August 2009 (1)
- June 2009 (2)
- May 2009 (3)
- April 2009 (6)
- March 2009 (5)
- February 2009 (5)
Category Archives: C++
C++ Const Constructability
[Inspired by CppQuiz #264] Take this code snippet: It fails to compile in gcc, with: error: ‘const struct C’ has no user-provided default constructor and the implicitly-defined constructor does not initialize ‘int C::i’ Clang and icc give similar error messages. … Continue reading
Posted in C++
Leave a comment
On OMP_WAIT_POLICY
Some years ago I encountered a crash that I reduced down to the following toy code, composed of a dll: and a console app: As emphasized and commented, FreeLibrary causes a crash – typically (but not always) an access violation, … Continue reading
Posted in C++, VC++
2 Comments
CMake Rants
CMake is a highly popular ‘meta-build’ system: it is a custom declarative syntax that is used to generate build scripts for all major OSs and compilers (e.g., VS solutions and projects). Designing such a system is a formidable task, but … Continue reading
Posted in C++
19 Comments
Executing Code Once Per Thread in an OpenMP Loop
Take this toy loop: Now suppose you want to run some preparation code once per thread – say, SetThreadName, or SetThreadPriority or whatnot. How would you go about that? If you code it before the loop the code would execute … Continue reading
Posted in C++, VC++
5 Comments
x86/x64 Numerical differences – Correction
In a previous post a truncation scheme was suggested, to circumvent x86/x64 differences in math library implementations: Since then, I accumulated some mileage with the scheme and have come to understand that line 8: -is flawed. Since we drop the … Continue reading
Posted in Algorithms, C++, VC++
Leave a comment
C++ Template Meta Programming is Still Evil
I won’t include a meta-programming intro paragraph here, since if you’re not familiar with it – I sincerely hope you stay that way. If you insist, get an idea online or read the book (it’s a good read, but can’t … Continue reading
Posted in C++
36 Comments
Ternary Operator and Type Compatibility
The (?,:) operator, as in – is commonly referred to as the Ternary Operator. (It is a common abuse of terminology: a ternary operator is one that operates on three arguments. This particular ternary operator is the Conditional Expression operator.) … Continue reading
Posted in C++
4 Comments