Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 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 Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 16 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 17 | |
| 18 | template <class T, class U> |
| 19 | void test_add_rvalue_reference() |
| 20 | { |
| 21 | static_assert((std::is_same<typename std::add_rvalue_reference<T>::type, U>::value), ""); |
| 22 | } |
| 23 | |
Howard Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 24 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 25 | |
| 26 | int main() |
| 27 | { |
Howard Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 28 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 29 | 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 Hinnant | 73d21a4 | 2010-09-04 23:28:19 +0000 | [diff] [blame^] | 36 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 37 | } |