using A = std::decay<int>::type;
using B = std::decay<int&>::type;
using C = std::decay<int&&>::type;
using D = std::decay<const int&>::type;
using E = std::decay<int[2]>::type;
using F = std::decay<int (int)>::type;
using G = std::decay<volatile int>::type;
using H = std::decay<const volatile int&>::type;
Agreed. The only C++ I regard as obscure is stuff I found in Mark Joshi's book on pricing patterns using stuff so obscure even STL experts find it obscure. Unsurprisingly I never used it in industry as it was all a bit too obscure.
Funky looking stuff but unless it's going to make an algorithm run 10x times faster I couldn't care less.
Funky looking stuff but unless it's going to make an algorithm run 10x times faster I couldn't care less.
C++11/C++14 is shifting in the direction of compile-time polymorphism and away from subtype polymorphism to a) reduce code bloat b) improve performance over virtual functions c) catch bad designs and errors at compile-time.
"Yes, seriously, C++17 brings std::variant. This is cool, and paves the way for future features building upon variant and other related ideas. Such as pattern matching, [...] std::variant is designed with the experience of boost::variant and other variant libraries."
double S = 2.0; double K = 65.0; double h = 1.0;
double sum = 0.0;
for (int i = 1; i <= 100; ++i)
{
sum += std::sqrt(S / K); S -= h;
std::cout << i << ",";
}
std::cout << std::boolalpha << "Sum: " << sum << '\n';
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.