- Joined
- 4/14/13
- Messages
- 784
- Points
- 73
He's a show-off :D
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.These are all fairly basic and well-documented.
Not obscure RTFM :D
Most vexing parse
????
Did Jack Benny invent the joke “How do you get to Carnegie Hall?” whose punch line is “Practice, practice, practice”?C++ is not easy, it is not !
double CdfNormal(double x)
{ // aka N(x)
const double sqrt2Inv = 1.0 / std::sqrt(2.0);
return 0.5*(1.0 + std::erf(x * sqrt2Inv));
}
int main()
{
[&]
()
{}
;
[=]
()
{}
;
}
struct C
{
C() = default;
template <typename... Args>
C(Args... args)
{
}
};
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';