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.
12345678910111213141516#include <print>#include <string_view>
// The return type is a trailing decltype of the parameter. Only the// parameter name is in scope at that point, so this form is required.template <typename T>auto describe(T const& t) -> decltype(t.size()) { return t.size();}
int main() { std::string_view greeting = "hello"; std::println("size: {}", describe(greeting)); return 0;}