1//
2// Test that an rvalue can't be passed to ref()
3//
4// Copyright 2014 Agustin Berge
5//
6// Distributed under the Boost Software License, Version 1.0.
7// See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt
9//
10
11#include <boost/core/ref.hpp>
12
13int main()
14{
15 boost::reference_wrapper<int> r = boost::ref( 2 ); // this should produce an ERROR
16 (void)r;
17}
18

source code of boost/libs/core/test/ref_rv_fail2.cpp