#include <iostream>

int main()
{
    auto i = 1;
    auto const& ref = i;
    std::cout << ref << '\n';
    i++; // This is fine
    std::cout << ref << '\n';
    // ref++; // This is not

    auto const j = 1;
    auto const& jref = j; // this is allowed
    // auto& ref = j; // not allowed
    std::cout << jref << "\n";
}