We've already covered C++11 decltype and why you should start using C++11 features today. Now we will move on to one of the most widely supported C++11 features: the new auto keyword.
auto is supported currently by g++ as of 4.4, clang and msvc since 10. So you are safe using it today if you don't need to support any older compilers.
Recently, while watching the GoingNative conference, I learned about the new std::shared_ptr helper function std::make_shared. In the talk Stephan T. Lavavej discusses the performance improvements they've made. It seems std::make_shared can save a few extra allocations and a bit of memory overhead. This can be significant if you dynamically create lots of objects.
I like to connect to Virtual Box guest operating systems remotely over RDP connections. This generally works well except if I connect from my 1280x720 laptop to a Windows guest. In this case the Windows guest will tend to resize to a "standard" resolution that fits inside of the 1280x720, which is 800x600. This can be rather obnoxious.
Quick, which language is the following code written in?
%:include <iostream> int main(int, char *argv<:??)) <% int i = 0; int j = 0; for (; i < 10 and j < 11; ++i, ++j) ??< std::cout << not (i bitand j) << std::endl; %> ??>
If you guessed standard C++, you'd be correct. C and C++ support a set of alternative tokens and character sequences to account for languages and keyboards that do not have easy access to characters that those of us with US keyboards consider to be normal.
Trigraph Sequences
Every major platform and compiler now supports some aspect of the new C++ standard accepted in 2011. This means it is currently possible to write code that uses some of C++11 while maintaining cross-platform compatibility.
Why should you care?
Neither C++ Coding Standards nor Effective C++ addresses the question of which float point type is best to use and in what situations.
There are three floating point types in C and C++:
floatdoublelong doubleWhat the Standard Has to Say
There are exactly two guarantees provided by the standard:
Recent comments
1 hour 40 min ago
1 hour 40 min ago
11 hours 54 min ago
13 hours 21 min ago
13 hours 22 min ago
13 hours 22 min ago
20 hours 38 min ago
2 weeks 3 days ago
4 weeks 4 days ago
4 weeks 4 days ago