language: C++ 4.7.2 (gcc-4.7.2)
date: 125 days 12 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
 
// Valid example:
void foo(const int& x)
{
    std::cout << x << std::endl;
}
 
int main()
{
    // legal; the temporary is bound to a const reference, so the compiler doesn't have to worry about foo() modifying it
    foo(7 * 6);
}