Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 267 Bytes

016.md

File metadata and controls

29 lines (24 loc) · 267 Bytes
//difficulty level: easy

#include <iostream>

void g(int &&r)
{
    r += 3;
    std::cout << r;
}

void g(int &r)
{
    std::cout << r++;
}

template<typename T>
void f(T&& x)
{
    x *= 5;
    g(x);
    g(std::forward<T>(x));
}

int main()
{
    f(1);
}