blob: 86a5696f48cad986c268f56a2f2e751f86431ef9 [file] [log] [blame]
Howard Hinnantc52f43e2010-08-22 00:59:46 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantc52f43e2010-08-22 00:59:46 +00007//
8//===----------------------------------------------------------------------===//
9
10// <functional>
11
12// reference_wrapper
13
14// template <ObjectType T> reference_wrapper<T> ref(T& t);
15
16// Don't allow binding to a temp
17
18#include <functional>
19
20struct A {};
21
22const A source() {return A();}
23
24int main()
25{
26 std::reference_wrapper<const A> r = std::ref(source());
27}