//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <functional>
// reference_wrapper
// reference_wrapper& operator=(const reference_wrapper<T>& x);
#include<functional>#include<cassert>classfunctor1:publicstd::unary_function<int,char>{};template<classT>voidtest(T&t){std::reference_wrapper<T>r(t);Tt2=t;std::reference_wrapper<T>r2(t2);r2=r;assert(&r2.get()==&t);}voidf(){}voidg(){}voidtest_function(){std::reference_wrapper<void()>r(f);std::reference_wrapper<void()>r2(g);r2=r;assert(&r2.get()==&f);}intmain(){void(*fp)()=f;test(fp);test_function();functor1f1;test(f1);inti=0;test(i);constintj=0;test(j);}