Fundamentals2 / 15
Up next

auto and bindings

#include <print>
#include <string>

int main() {
    // auto deduces int, double, and std::string here
    auto count = 42;
    auto ratio = 3.5;
    auto label = std::string{"items"};
    std::println("{} {} {}", count, ratio, label);
}
What you're solving

let the compiler deduce the type