Something went wrong. Try again.
A Tour of C++ for experienced programmers, as if C++26 is the only version that ever existed.
Something went wrong. Try again.
123456789101112#include <type_traits>#include <iostream>
template <typename T>constexpr T pi = static_cast<T>(3.1415926535897932385L);
int main() { static_assert(pi<double> == 3.1415926535897932385); std::cout << "pi<double> = " << pi<double> << '\n'; return 0;}