blob: c1e2a23f629de880986f16cf8562d096d87ccfa5 [file] [log] [blame]
Howard Hinnantc52f43e2010-08-22 00:59:46 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// type_traits
11
12// add_rvalue_reference
13
14#include <type_traits>
15
Howard Hinnant73d21a42010-09-04 23:28:19 +000016#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantc52f43e2010-08-22 00:59:46 +000017
18template <class T, class U>
19void test_add_rvalue_reference()
20{
21 static_assert((std::is_same<typename std::add_rvalue_reference<T>::type, U>::value), "");
22}
23
Howard Hinnant73d21a42010-09-04 23:28:19 +000024#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantc52f43e2010-08-22 00:59:46 +000025
26int main()
27{
Howard Hinnant73d21a42010-09-04 23:28:19 +000028#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantc52f43e2010-08-22 00:59:46 +000029 test_add_rvalue_reference<void, void>();
30 test_add_rvalue_reference<int, int&&>();
31 test_add_rvalue_reference<int[3], int(&&)[3]>();
32 test_add_rvalue_reference<int&, int&>();
33 test_add_rvalue_reference<const int&, const int&>();
34 test_add_rvalue_reference<int*, int*&&>();
35 test_add_rvalue_reference<const int*, const int*&&>();
Howard Hinnant73d21a42010-09-04 23:28:19 +000036#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantc52f43e2010-08-22 00:59:46 +000037}