summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp
blob: 22ad0b8a2e5190b2ab45b0cc89b9bb557d7d7bfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<const T> cref(const T& t);

#include <functional>
#include <cassert>

int main()
{
    int i = 0;
    std::reference_wrapper<const int> r = std::cref(i);
    assert(&r.get() == &i);
}
OpenPOWER on IntegriCloud