Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++perfect forwarding std::forwardSingle-choice MCQ

What is printed by this program that forwards into an overload set?

void f(int&) { std::cout << "lref"; } void f(const int&) { std::cout << "clref"; } void f(int&&) { std::cout << "rref"; } template <typename T> void g(T&& x) { f(std::forward<T>(x)); } int main() { const int ci = 5; g(ci); }