#include #include "borrow_checker.hpp" int main() { auto i = 42; // borrow `i` under name `ref` borrow_var(ref, i) { // ++i; - error // *ref = 0; - error std::cout << *ref << ' ' << i << '\n'; }; // mutable borrow `i` under name `ref` mut_borrow_var(ref, i) { // auto var = i; - error *ref = 42; }; ++i; }