#include <iostream> void intPrinter(int& x) // Lvalue reference { std::cout << "LHS Int printer : " << x << '\n'; } void intPrinter(int&& x) // Rvalue reference { std::cout << "RHS Int printer : " << x << '\n'; } int main() { auto formatPrinter = [](auto&& x) // Universal reference { std::cout << "-------" << '\n'; intPrinter(std::forward<decltype(x)>(x)); std::cout << "-------" << '\n'; }; int num = 2; formatPrinter(num); formatPrinter(3); } /* Output ------- LHS Int printer : 2 ------- ------- RHS Int printer : 3 ------- */