diff options
Diffstat (limited to 'libcxx/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp new file mode 100644 index 00000000000..aa5ca530913 --- /dev/null +++ b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <utility> + +// template <class T1, class T2> struct pair + +// template<size_t I, class T1, class T2> +// typename tuple_element<I, std::pair<T1, T2> >::type&& +// get(pair<T1, T2>&&); + +#include <utility> +#include <memory> +#include <cassert> + +int main() +{ +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + { + typedef std::pair<std::unique_ptr<int>, short> P; + P p(std::unique_ptr<int>(new int(3)), 4); + std::unique_ptr<int> ptr = std::get<0>(std::move(p)); + assert(*ptr == 3); + } +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +} |